Skip to main content
Every agent has built-in tools for its workspace, Linux machine, and Artifacts. You can attach MCP servers, import operations from an OpenAPI document, and declare custom tools that your application executes.

Built-in tools

Pi adds tool_search when an Agent has deferred tools from an MCP server or an OpenAPI toolset. codemode cannot call custom tools or tools that require confirmation.

MCP tools

The model sees each tool on an Agent’s MCP server as mcp__<server>__<tool>. By default, every MCP call pauses for approval (evaluated_permission: "ask") unless an mcp_toolset allows it:
Store the server’s bearer token in a Vault.

OpenAPI toolsets

An openapi_toolset exposes operations from a JSON OpenAPI 3.0 or 3.1 document. This Pi Agent discovers its catalog operations through tool_search. Save this as catalog-agent.json. Set model to a model available on your deployment. The example catalog URL describes a sample service.
catalog-agent.json
Retrieving the Agent shows its compiled operations, including their input schemas, along with base_url and source. You can provide document_url for a public HTTPS JSON document. Checkfu reads the document when it creates the Agent version and records its source. The model sees mcp__catalog__getItem and mcp__catalog__getCategory. Calls ask for approval by default. The named getCategory configuration allows that call to run automatically. For an authenticated API, explicitly bind a prefix-scoped Credential to catalog when creating the Session. Its scope must cover the toolset’s base_url. An inline document shares the Agent’s request body limit. See Agents and Environments limits for the fetched document, toolset, operation, and compiled tools limits.

Custom tools

Declare custom tools on the Agent; your application handles running them.

Answer a paused turn

When the agent calls a custom tool or an MCP or OpenAPI tool that requires approval, the turn pauses with stop reason requires_action. Answer every waiting call in stop_reason.event_ids and the turn resumes:
See Add an agent to your app for the full relay and tool-handling loop, and Session events or Limits for exact fields and caps.