Calling Tools.
The model does not run the tool. It writes a request; something else runs it and writes back.
A language model can only produce text. Tool use turns some of that text into actions: the model is given descriptions of functions — a name, parameters and their types, usually as a JSON schema — and is trained to emit, when useful, a call in a fixed format. The serving software watches for that format, parses the call, runs the function and inserts the result into the context as a new message; generation continues with the result in view. Function calling in commercial APIs, code execution and web search all work this way, often with special tokens marking where a call starts and ends.
The tool world of this part: the character model of Vol. XVII, pre-trained only on single-digit worksheets, is fine-tuned in the page to call a calculator — it writes “B23+45|”, the environment appends the result “68|”, and the model answers “68|”. Two-digit sums are beyond the model: it has only ever seen single digits added. The workshop fine-tunes it on demonstrations that call the calculator, or on demonstrations that answer directly, and measures both on 30 held-out sums.
Below: held-out transcripts from the model fine-tuned to call the calculator; the bars compare held-out success with the tool and when trained to answer directly.
- Describe a tool call as structured text.
- Explain who executes the tool.
- Teach a model a call format from demonstrations.
- See a tool extend what a model can do.
Copy the operands, not compute the sum
Trained on 70 demonstrations for 400 steps, the model writes a well-formed call and copies the answer back on 100% of held-out sums; trained on the same sums to answer directly, it gets 10% of them — it memorises its 63% of training answers and has no way to compute new ones. The tool did not make the model better at arithmetic; it changed the task into one the model can do, copying two numbers into a format. With 30 demonstrations it reaches 7%, and with only 100 steps 7%: even copying needs data.
Every real tool-using system has the same division of labour. The model writes the request; the harness validates it against the schema, executes it with whatever permissions it has (plate XXV.8), and returns the result as text the model reads. A malformed call is an error the harness must handle — here 0% of episodes — and production systems constrain the call’s syntax with the grammar-masking of plate XXII.5. What the model must learn is when to call, what to put in the call, and how to use what comes back.
Terms
- Tool call
- Structured text the model writes for a program to execute.
- Schema
- The declared name, parameters and types of a tool.
- Harness
- The software that parses calls, runs tools and returns results.
- Function calling
- API support for declaring tools and receiving structured calls.
Sources
- Schick et al., “Toolformer: Language Models Can Teach Themselves to Use Tools”, NeurIPS 2023.
- Parisi, Zhao and Fiedel, “TALM: Tool Augmented Language Models”, arXiv:2205.12255, 2022.
- OpenAI, “Function calling” and Anthropic, “Tool use” API documentation (accessed October 2026).