Tool Use / Function Calling
The ability of an LLM to request execution of external functions, APIs, or tools, enabling it to act on the world rather than just generate text.
Function calling (OpenAI's term) or tool use (Anthropic's term) is the mechanism by which LLMs move from text generators to active systems. The model is given a list of available functions with their signatures and descriptions. When it determines a function is needed, it outputs a structured call rather than a text response. The application executes the function and returns results to the model, which continues generation.
The standard pattern
A typical tool-use API interaction looks like:
- Provide the model with a list of tool schemas (name, description, parameters as JSON Schema)
- Model responds with a tool_call object:
{"name": "get_weather", "arguments": {"city": "London"}} - Application executes the function and returns the result
- Model incorporates the result and produces the final response
Multi-step tool use
Agents chain multiple tool calls to complete complex tasks: search the web, read a document, run a calculation, write a file. Each step adds to the context window, so long tool-use chains consume tokens quickly. This is one reason context window size matters for agentic workloads.
Reliability considerations
Models can hallucinate function arguments, call functions in the wrong order, or get stuck in loops. Mitigation strategies include: strict JSON Schema validation of arguments, clear function descriptions, limiting the number of available tools (models perform worse with very large tool sets), and building in human approval steps for irreversible actions.
Related terms
Models relevant to Tool Use / Function Calling
Claude Sonnet 4.6
Anthropic's best balance of speed, intelligence, and cost for production workloads
View model →GPT-4o
OpenAI's multimodal workhorse - fast, affordable, and widely integrated
View model →Mistral Large
Europe's leading frontier model - strong on code, multilingual tasks, and function calling
View model →Command R+
Cohere's enterprise model purpose-built for RAG and production tool-calling pipelines
View model →