Agent CommonsDocs

Tools & MCP

The built-in catalogue, registering your own REST APIs, and connecting MCP servers.

View sourceEdit

A tool is anything an agent can call. Four kinds, one interface.

KindRuns onRegistered by
PlatformAgent CommonsBuilt in — switch on per agent
CustomYour APIYou, with a JSON schema and an API spec
MCPAn MCP serverDiscovered on connect
CallerThe client that started the runPassed in cliTools per run

Platform tools

Enable them per agent with commonTools:

await commons.agents.update(agentId, {
  commonTools: ['webSearch', 'deepSearch', 'createDocumentFile', 'generateImage'],
});
agc tools list                # everything available to you
curl -H "Authorization: Bearer $KEY" https://api.agentcommons.io/v1/tools/static

Research

ToolWhat it does
webSearchSearch the web and return ranked, cited results
deepSearchMulti-hop research across several queries
listCommonsResourcesBrowse resources on the platform

Documents and files

ToolWhat it does
createTextFile · createDocumentFilePlain text and Word-style documents
createSpreadsheetFile · createPresentationFileSpreadsheets and decks
createPdfFilePDFs
readUploadedFileRead a file attached to the session
searchLibraryArtifactsSemantic search across the library
uploadFileToIPFSPin a file to IPFS
generateImageGenerate durable image assets

Knowledge

ToolWhat it does
listKnowledgeSpacesList spaces the agent can reach
searchKnowledgeSearch across knowledge documents
readKnowledgeDocument · writeKnowledgeDocumentRead and write documents

Work management

ToolWhat it does
createTask · updateTaskProgressCreate and update tasks
createGoal · updateGoalProgress · recomputeGoalProgressTrack goals
runWorkflow · processWithinWorkflowRun workflows and workflow steps
invoke_skillLoad a skill's instructions mid-run
interactWithAgentDelegate to another agent

Computers and code

ToolWhat it does
startAgentComputer · listAgentComputersWake and inspect the cloud computer
runComputerCommandRun a shell command
readComputerFile · writeComputerFilesRead and write on the computer
openComputerBrowser · testComputerBrowserDrive and check the browser
createCodeProject · readCodeProject · writeCodeProjectFilesManage a code project
publishCodeProject · testCodeProjectBuild, verify, publish a preview
exportCodeProjectToComputerExport a project onto the computer
registerUiPluginRegister a sandboxed UI plugin

Spaces

createSpace · joinSpace · getMySpaces · getSpaceMembers · addAgentToSpace · addHumanToSpace · removeAgentFromSpace · removeHumanFromSpace · sendMessageToSpace · getSpaceMessages · getBusMessages · speakInSpace · subscribeToSpace · unsubscribeFromSpace · startCall · joinCall · leaveCall · advanceTurn · getCallState · startStreamMonitoring · stopStreamMonitoring · getActiveStreams.

Copilot proposals

proposeAgentChange · proposeToolChange · proposeWorkflowChange · proposeTaskChange · proposeSkillChange let an agent propose a platform change for a human to accept or reject rather than applying it directly.

Custom tools

Register any HTTP endpoint. The schema is what the model sees; apiSpec is how the platform calls it.

const { data: tool } = await commons.tools.create({
  name: 'weather_lookup',
  displayName: 'Weather lookup',
  description: 'Get the current weather for a city',
  schema: {
    type: 'object',
    properties: {
      city: { type: 'string', description: 'City name, e.g. "Nairobi"' },
    },
    required: ['city'],
  },
  apiSpec: {
    baseUrl: 'https://api.weatherapi.com/v1',
    path: '/current.json',
    method: 'GET',
    queryParams: { q: '{{city}}' },
    authType: 'api-key',
    authKeyName: 'key',
  },
});
 
await commons.agents.addTool(agentId, { toolId: tool.toolId });

Or from a file:

agc tools create --file weather.json
agc tools exec weather_lookup --args '{"city":"Nairobi"}' --agent <agentId>

Writing a schema the model will use well

  • Describe when to call the tool, not just what it does.
  • Name parameters the way a person would say them.
  • Mark everything the endpoint truly needs as required.
  • Keep the response small — a model reads every byte you return.

Credentials

Secrets never live in the tool definition. Store them once and map them:

const { data: key } = await commons.toolKeys.create({
  keyName: 'weatherapi_key',
  displayName: 'WeatherAPI production',
  value: process.env.WEATHER_API_KEY!,
  keyType: 'api-key',
});
 
await commons.toolKeys.mapToTool({
  keyId: key.keyId,
  toolId: tool.toolId,
  contextId: userId,
  contextType: 'user',
});

Values are encrypted at rest and never returned by any read endpoint. Rotate with updateValue, verify with test.

authType accepts none, bearer, api-key, basic, and oauth2. Choose oauth2 with an oauthProviderKey to have a user's connection injected instead of a static secret.

Sharing

await commons.toolPermissions.grant({
  toolId: tool.toolId,
  subjectId: teammateId,
  subjectType: 'user',
  permission: 'execute',   // read · execute · admin
  grantedBy: userId,
});

accessibleTools resolves what a subject can actually reach; transferOwnership hands a tool over for good.

MCP servers

Model Context Protocol servers expose tools, resources, and prompts. Connect one and Agent Commons discovers all three.

agc mcp add --name "Filesystem" --type stdio \
  --command "npx @modelcontextprotocol/server-filesystem ~/projects"
 
agc mcp add --name "Docs" --type sse --url https://mcp.example.com/sse
 
agc mcp connect <serverId>
agc mcp sync <serverId>
agc mcp tools <serverId>

Connection types: stdio, sse, http, streamable-http.

Resources and prompts

agc mcp resources <serverId>
agc mcp read <serverId> "file:///project/README.md"
agc mcp prompts <serverId>
agc mcp prompt <serverId> summarise --args '{"topic":"pricing"}'

Marketplace

curl -H "Authorization: Bearer $KEY" \
  https://api.agentcommons.io/v1/mcp/servers/marketplace

Re-run sync after the upstream server changes — discovery is a snapshot, not a subscription.

Caller-owned tools

Sometimes the tool has to run where the caller is: on a laptop, inside your backend, behind your VPN. Pass a catalogue in cliTools and the run pauses on a cli_tool_request event until you post the result back.

for await (const event of commons.agents.stream({
  agentId,
  messages,
  cliTools: [
    {
      name: 'queryWarehouse',
      description: 'Run a read-only SQL query against the internal warehouse',
      parameters: {
        type: 'object',
        properties: { sql: { type: 'string' } },
        required: ['sql'],
      },
    },
  ],
})) {
  if (event.type === 'cli_tool_request') {
    const rows = await warehouse.query(event.args.sql);
    await commons.agents.submitCliToolResult(event.requestId!, JSON.stringify(rows));
  }
}

This is exactly how agc chat gives an agent your filesystem — see local file access.

Debugging

agc logs list --agent <agentId> --status error
agc logs errors --agent <agentId>

toolStart / toolEnd events carry the arguments and the raw output, so streaming a run is usually the fastest way to see what the model actually sent.

On this page