Agents & Tools
How a language model calls tools, loops on their results, and speaks a protocol to reach them.
Machine Learning · How Computers Work
Before you start
Some lessons here build on lessons from other arcs: The Transformer Block.
- 1
Tool Callingin progress
ML · Agents & Tools · ~20 minA model's tool call is text until the harness makes something of it: parse it, look the tool up, check every argument against the schema, run it, and hand the result back. Every step can say no.
- 2
The Agent Loop: Model, Harness, Toolsin progress
ML · Agents & Tools · ~30 minAn agent is a loop: the model proposes, the harness runs the tool and appends what came back, and round it goes until an answer, a turn cap, a token budget, or too many errors. The model is a script.
- 3
JSON-RPC: Requests, Responses, and Idsin progress
Computers · Networking · ~20 minA call is a line of JSON with a method, params, and an id; the reply comes back under the same id, in any order. Leave the id out and nothing comes back at all. The wire is someone else's problem.
- 4
MCP: The Model Context Protocolin progress
ML · Agents & Tools · ~30 minJSON-RPC with a lifecycle and a vocabulary: initialize negotiates version and capabilities, then the client lists and calls tools, reads resources, and gets prompts, asking only for what was offered.