Curiosity · Concept
Tool Calling (Function Calling)
A tool-calling LLM is given a JSON schema of available functions (name, parameters, description) and, when the prompt warrants it, outputs a tool_call block instead of prose. The runtime parses the call, executes the matching function, and feeds the result back into the conversation. This is the backbone of every modern agent — ReAct, browsing, code execution, database querying, MCP — and it's how LLMs escape their training-time knowledge cutoff. OpenAI, Anthropic, Google, and the MCP ecosystem all expose near-equivalent tool-calling APIs.
Quick reference
- Proficiency
- Beginner
- Also known as
- function calling, tool use
- Prerequisites
- structured output, prompting basics
Frequently asked questions
What is tool calling?
Tool calling is the capability where an LLM, given JSON schemas describing available functions, emits a structured call (name + arguments) for the runtime to execute. The result is fed back and the model continues — this is how agents use calculators, APIs, databases, and browsers.
How is it different from a plain structured output?
Structured output returns JSON as the final answer. Tool calling is a loop: the model's JSON is a request that the runtime fulfills, after which the model keeps generating. Most APIs run this loop until the model emits a normal text response instead of another tool call.
How should I design tools?
Few tools, each with a clear name, one-sentence description, minimal required parameters, and well-typed schema. Avoid overlapping tools (model picks badly), and describe error cases in the tool description so the model recovers gracefully.
What about parallel or nested tool calls?
Modern APIs support parallel tool calls (several in one turn) and chained calls (result of one feeds the next). Use parallel for independent lookups to cut latency; chain when outputs genuinely depend on each other.
Sources
- Anthropic — Tool use with Claude — accessed 2026-04-20
- OpenAI — Function calling guide — accessed 2026-04-20