Tool use, also called function calling, is the mechanism that lets a language model trigger code instead of only producing prose. The model is given a set of tool definitions — names, descriptions, and parameter schemas — and when it decides a tool is needed, it outputs a structured call matching one of those schemas. Your application code executes the actual function, and the result gets appended back into the model's context so it can continue reasoning or respond to the user with that information incorporated.
What changed in 2026
- Parallel tool calling became standard, not experimental — most frontier models can now emit multiple independent tool calls in a single turn, and providers optimized execution paths to run them concurrently.
- Structured output guarantees tightened. Constrained decoding (forcing the model's output to match a schema at the token level) is now widely used, which eliminated most malformed-JSON tool-call failures that plagued earlier prompting-only approaches.
- Tool selection at scale got harder, and got studied more. As agent systems shipped with dozens of tools, "too many tools" became a documented accuracy problem, prompting dynamic tool filtering (only exposing a relevant subset per request) as a common mitigation.
- Tool results started counting meaningfully against context budgets, pushing teams toward summarizing or truncating large tool outputs before feeding them back to the model.
How the tool-calling loop works
- The application sends the user's message plus a list of available tools (name, description, JSON schema for parameters) to the model.
- The model decides whether a tool is needed. If not, it responds normally. If so, it emits a structured call: which tool, with which arguments.
- The application executes the call against the real function or API — the model never runs code directly, it only requests that your system do so.
- The result is appended to the conversation as a tool-result message, and the model is called again with that new context.
- The model either calls another tool or produces a final response incorporating the result.
This loop can run once or many times per user turn, which is the core building block that turns a chatbot into an agent.
Designing tools models actually use correctly
| Design choice |
Effect on accuracy |
| Clear, distinct tool names |
Reduces confusion between similar tools |
| Detailed parameter descriptions |
Reduces malformed or wrong-typed arguments |
| Small, focused tool set (roughly under 15–20 active) |
Improves selection accuracy significantly |
| Overlapping tools with similar purposes |
Increases wrong-tool selection |
| Returning large raw payloads |
Wastes context, can push out earlier instructions |
| Returning summarized, structured results |
Preserves context budget, improves downstream reasoning |
Common failure modes
Wrong tool selected among similar options. If two tools do almost the same thing with subtly different scopes, models frequently pick the wrong one. Merging or clearly differentiating them fixes most of this.
Hallucinated arguments. A model can emit a syntactically valid call with a plausible-looking but incorrect argument value, especially for free-text parameters without an enum constraint. Constraining parameters to enums or validated formats where possible reduces this.
Partial failure in parallel calls. When three tools are called at once and one fails, the application needs an explicit strategy — retry, surface the error to the model, or abort — rather than silently ignoring it. This is also where AI observability tooling earns its keep, since tracing which call failed inside a multi-step run is otherwise difficult after the fact.
Context bloat from verbose tool results. Returning an entire API response instead of the relevant fields eats into the context window and can degrade the model's later reasoning quality.
FAQ
Does tool use require a specific model architecture?
No, but it requires the model to be trained or fine-tuned to emit structured tool calls reliably. Most current frontier models support this natively; older or smaller models may need heavier prompting or constrained decoding to get comparable reliability.
Can a model call a tool without my code approving it first?
The model can request a call, but your application decides whether to execute it. Adding an approval step for consequential actions (deleting data, sending money, making purchases) is a standard safety pattern.
How many tools can a model handle at once?
There is no hard limit, but accuracy on tool selection measurably degrades as the count grows, particularly past a few dozen. Dynamic filtering to a relevant subset per request is the common fix at scale.
Is function calling the same as an agent?
No. Function calling is the mechanism; an agent is a system that uses that mechanism in a loop with planning and self-correction. A single tool call in a single turn is not, by itself, agentic behavior.
Where to go next