Lab

Tool calling

Tool calling: A model outputting a structured request, such as a tool name and its arguments, that ordinary software reads, checks and runs on the model's behalf.

A language model cannot open a file, search the web or send an email. It can only output text. Tool calling is the arrangement that turns some of that text into actions.

The harness tells the model which tools exist, usually with a name, a short description and the arguments each one takes. When the model outputs text in an agreed shape, for example a tool name followed by its arguments, the harness recognises it as a request rather than an answer. It checks the request, runs the matching code, and pastes the result back into the context for the model to read on its next turn.

So the model outputs a tool call; the harness runs it. The model never touches the file or the network directly, and a tool the harness does not offer cannot be called at all. That boundary is where permissions, approvals and logging belong.

Models are trained to produce these calls. Toolformer showed a model learning when a call would help and how to use what came back. Getting the call right is still not guaranteed: a model can pick the wrong tool, invent an argument, or call a tool when it should not. Benchmarks such as the Berkeley Function Calling Leaderboard measure this, and find multi-step use harder than single calls.

Different systems format tool calls differently. The explainer shows them as readable text rather than any one vendor’s format.

See it working

Explore it in How an AI agent works

Step through a model calling tools in a loop, and see how the harness around it decides what it sees, what it may touch and when it stops.

Open the explainer