Tool Calling
The ability of a model to return a structured command: which tool to call and with what arguments.
What Sets It Apart from Function Calling
Essentially, it is the same thing. The difference lies in terminology: tool calling is more commonly used in the context of OpenAI-compatible APIs, while function calling is a general term for calling external functions.
How It Works
sequenceDiagram
participant L as LLM
participant C as Code
participant T as Tool
L->>C: tool_call: get_weather({city: "Moscow"})
C->>T: Execute
T-->>C: +12 °C
C->>L: Result
L->>L: Final response
Structure of a Tool Call
The model returns a JSON object:
{
"name": "get_weather",
"arguments": {
"city": "Moscow"
}
}
Tool Description
The model needs to know which functions are available. The description is passed in JSON Schema format — with name, parameters, and types.