Tool calling patterns
Tool calling lets models respond with structured function names and arguments your application can execute.
Overview
Tool calling (also called function calling) lets models respond with structured function names and arguments that you can execute in your application. It enables models to interact with external systems, retrieve real-time data, and power agentic AI workflows.
Pass function descriptions to the tools parameter, and the model returns tool_calls when it determines a function should be used. You then execute these functions and optionally pass the results back to the model for further processing.
- Your appsends a requestmessages + tools
- Modelreturns tool_callstool_calls
- Your appruns the functionsresults appended to messages
- Modelevaluates the resultsmore tool_calls, or a final answer
- Final responsereturned to your appno more tool_calls
Steps 2–4 repeat while the model keeps returning tool_calls; the loop ends when a response has none.
Patterns
Tool calling fits a handful of common shapes. Pick the one that matches what you’re building, then follow the link for runnable Python, TypeScript, and cURL examples.
| Pattern | Description | Use cases | Page |
|---|---|---|---|
| Simple | One function, one call | Basic utilities, simple queries | Call functions |
| Multiple | Choose from many functions | Many tools, model has to choose | Call functions |
| Parallel | Same function, multiple calls in one turn | Complex prompts, batched lookups | Parallel calls |
| Parallel multiple | Multiple functions, parallel calls | Single requests that need many tools | Parallel calls |
| Multi-step | Sequential tool calling in one turn | Data-processing workflows | Agentic patterns |
| Multi-turn | Conversational context plus functions | Agents with humans in the loop | Agentic patterns |
Supported models
Native tool calling is declared on deepseek4-flash, deepseek-v4-pro, glm5.3, glm5.3-flash, qwen3.8-27b and reka-edge-2603. reka-flash-3 does not declare tools: sending them is not an error, but it returns 200 with no tool_calls and reasons about the request in reasoning_content instead. reka-edge-2603, glm5.3-flash and qwen3.8-27b also accept image inputs alongside tools, so you can extract structured data from pictures through function calls.
The feed at GET /v1/models is authoritative. See the model catalog for the current list.