Tool calling
Tool calling lets a model ask the application to run a function and return the result. How the round trip works, and the tool limits in AI CodeOps sessions.
Tool calling, also called function calling, is a model capability in which the model returns a structured request to run a named tool with arguments, instead of plain text. The application runs the tool and sends the result back, and the model continues.
What it is
The round trip, as described in Anthropic's tool use docs:
- The request lists the tools, each with a name, a description and a JSON Schema for its input.
- The model decides to call one and stops with a
tool_useblock naming the tool and its input. - Your code runs the tool and sends a
tool_resultback. - The model uses the result to answer, or calls another tool.
Some tools run on the provider's side instead, such as web search. Tool definitions and results all count as input tokens.
Why it matters
Tools are how an agent stops just talking and starts acting: reading a file, searching an issue tracker, running a command. Every tool is also a permission, so which tools an agent sees deserves as much care as what it's told.
In AI CodeOps
Agents in a session call tools from the remote MCP servers you add. As the agents see them:
tool names <server>__<tool>
per session up to 32 MCP tools
per step up to 6 rounds of tool calls
per call 30-second timeout; long results are shortened
Tools a policy rule denies, or an agent's permissions exclude, are removed before the model sees the list.
Frequently asked questions
Is tool calling the same as function calling?
Yes. Providers use both names for the same thing: the model returns a structured request to call a named function with arguments.
Can a model call a tool it wasn't given?
In AI CodeOps, no. A tool name the model makes up isn't in the session's list, so the call can't run.