Get an API key
api.agents

Options · tools and library

tools · skills · subagents · mcp · agent

Which of the 36 tools the model is told about, which skills and subagents it may reach, and which connected MCP servers. Everything here costs tokens on every turn.

all by defaultunknown is refuseddeclarations cost tokens
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

toolsstring[] | "all"all 35

Which built-in tools. An unknown name is refused with unknown_tool.

skillsstring[]all

Which skills. [] for none.

subagentsstring[]all

Which subagents. [] for none — and then no task tool.

mcpstring[] | stringall connected

Which MCP servers. [] for none.

agentstringnull

Run the whole conversation as this library agent — its role, model and tools.

api.agents.create({
  runtime: "local", machine: pc, model: "gemini-3.5-flash",
  tools: ["read", "list", "glob", "grep", "write", "edit", "multi_edit", "bash"],
  skills: ["house-style"],
  subagents: [],          // no delegation
  mcp: [],                // no third-party tools
});
api.agents.create(
    runtime="local", machine=pc, model="gemini-3.5-flash",
    tools=["read", "list", "glob", "grep", "write", "edit", "multi_edit", "bash"],
    skills=["house-style"],
    subagents=[],           # no delegation
    mcp=[],                 # no third-party tools
)

Why fewer is cheaper

Every declaration is sent with every turn

On a job that only reads and edits, cutting the services and the media tools removes a fixed cost from each step — and removes their instructions from the system prompt with them. The cost of an agent is its number of turns, but the width of a turn is this list.

Some tools leave on their own

bash without a shell on a phone, terminal on a phone at all, skill and task with an empty library, ask_user with no onQuestion, memory with memories: false. A tool that could not run is not declared, so the model never plans around it.

The library is re-read every run

Something added from another window is available without restarting whatever holds the package. libraryStatus says why a library came back empty — « none » for no source, a code for a refusal.

agent: running as a library agent

The whole conversation takes that agent's instructions, model and tool selection, while keeping ask_user, todo_write and memory. A name that is not a library name is refused with invalid_agent.

MCP servers are tools too

Each allowed tool of a connected server is one more declaration on every turn — which is why servers are chosen per run and allowed tools per connection.