Anatomy of a Tool Call
Step-by-step breakdown of an LLM tool call: request, schema validation, execution, and result handling with code examples.
Last updated
Anatomy of a Tool Call
A tool call is not one thing — it is four moving parts handing structured text to each other. Learn the parts, the wire format, and the schema-design levers, and every agent stops being a black box.
A “tool call” is not a function invocation — it is a four-part relay. You write a schema, the model emits a tool_use block, your dispatcher validates and runs the real code, and a tool_result travels back. Every provider, every framework, every MCP server is just a different skin over these four parts. Name them in an interview and you sound like someone who has shipped agents, not read about them.
The Four Moving Parts
Whether you are wiring up Claude, GPT, Gemini, or an MCP server, the same four components appear. Two you own, one the model owns, and one is the boundary you format: