# Tool calling

Tool calling is how a language model acts outside its own text. The model is given a set of tool
definitions, each with a name, a description, and an argument schema. When it decides a tool is
needed, it emits a structured call naming the tool and its arguments, the runtime executes the call,
and the result goes back into the model's context. The model can then answer or chain further calls,
and an agent is essentially this loop run until the task is done. Three model-side steps sit inside
it: choosing the tool, forming the arguments, and interpreting what comes back.

It exists because a model on its own can only generate text from what's already in its context.
Tools let it fetch data that changes, like a database row, a search result, or a calendar, run
computation it can't do reliably in its head, and take real actions like sending a message, editing
a file, or calling an API.

An agent reaches for a tool when the task needs something outside the model's context or beyond text
generation: current state it can't know, an action with side effects, or an answer that has to be
exact where a plausible guess isn't enough. The tool definitions the agent carries set what it can
do. Which tool the model picks, and the arguments it forms, decide what it actually does.

## Questions answered under this concept

- [Why did my agent call the wrong tool with invented arguments?](https://tessary.ai/answers/tool-calling/agent-called-wrong-tool-with-invented-arguments)
- [Can parallel tool calls break if one depends on the other running first?](https://tessary.ai/answers/tool-calling/can-parallel-tool-calls-break-an-order-dependency)
- [Does tool selection accuracy get worse as an agent gets more tools?](https://tessary.ai/answers/tool-calling/does-tool-selection-accuracy-get-worse-with-more-tools)
- [How reliable are MCP tool calls in production?](https://tessary.ai/answers/tool-calling/how-reliable-are-mcp-tool-calls-in-production)
- [What's the difference between tool calling and function calling?](https://tessary.ai/answers/tool-calling/tool-calling-vs-function-calling)
- [What are the ways a single tool call can fail?](https://tessary.ai/answers/tool-calling/what-are-the-ways-a-tool-call-can-fail)
- [What is tool calling?](https://tessary.ai/answers/tool-calling/what-is-tool-calling)

---

Source: https://tessary.ai/answers/tool-calling
All concepts: https://tessary.ai/answers
From Tessary, agent reliability for AI agents in production: https://tessary.ai
