Tool Use / Function Calling
The ability of an LLM to request execution of external functions, APIs, or tools by outputting structured function calls, enabling it to take actions beyond text generation.
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 receives a list of available functions with their schemas 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 follows these steps:
- 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. Context window size significantly affects agentic workloads because token consumption grows with each tool interaction.
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, concise function descriptions
- Limiting the number of available tools (performance degrades with very large tool sets)
- Human approval steps for irreversible actions
- Explicit error handling in tool responses so the model can recover from failed calls
Related terms
Models relevant to Tool Use / Function Calling
Claude Sonnet 4.6
Anthropic's most capable Sonnet-class model of early 2026, now superseded by Sonnet 5.
View model →GPT-4o
OpenAI's versatile, fast multimodal workhorse (text + image)
View model →Mistral Large
Mistral's state-of-the-art, open-weight, general-purpose multimodal flagship.
View model →Command R+
Cohere's RAG- and tool-use-optimized model, still live but superseded by Command A.
View model →