Tool calling
Tool calling, also known as function calling, lets a language model request an action from external software by producing a structured call, such as a function name and arguments in JSON. The application runs the tool, for example a search, calculation or database query, and returns the result to the model.
A developer describes the available tools to the model, each with a name, a description and a schema for its inputs. When a request needs one, the model outputs a call instead of plain text. The application validates it, executes the tool and sends the output back, and the model uses it to continue. The model never runs code itself; the application decides what is actually executed. Toolformer (Schick et al., 2023) is an early research example of models learning to use tools.
Why it matters: tool calling is what lets AI products fetch live data, take actions in other apps and give accurate answers on maths or current facts. It is the foundation of AI agents and of protocols such as MCP. When comparing models or platforms, reliability at choosing the right tool and filling in arguments correctly is a practical differentiator.
Example: asked "What's the weather in Singapore tomorrow?", an assistant calls a weather API with the city and date, then writes the answer from the returned forecast.
Limits: models can call the wrong tool, invent arguments or be tricked by malicious content into harmful calls. Validate inputs, restrict which tools are available and require confirmation for actions that change data.
Related terms
Learn it step by step
Sources
- Toolformer: Language Models Can Teach Themselves to Use Tools. Schick et al., arXiv, February 2023
- ReAct: Synergizing Reasoning and Acting in Language Models. Yao et al., arXiv, October 2022
Topic: AI agents
Last updated