Tool calling
Also called Function calling
Tool calling is the mechanism that lets a model do things beyond producing text. The model emits a structured request naming a tool and its arguments, the surrounding system executes it, and the result comes back as input for the model's next step.
Every capability an agent appears to have is a tool underneath. Reading a file, writing a file, running a command, searching the web — each is a defined function the model can request, and the agent framework performs and reports back.
This is also why agents fail in the specific ways they do. A tool that returns a confusing error, or a result the model misreads, sends the next step off course, and the model has no way to check the world independently of what its tools told it.
What this means in practice
It explains why execution matters so much. An agent that can run your tests gets ground truth about whether its change worked. One that cannot is reasoning about code it has never seen run.
Prompts for the tools this applies to
Related terms
- Agent loop
The agent loop is the repeating cycle an AI agent runs: decide what to do next, take an action such as reading a file or running a command, observe the result, and repeat.
- Agentic coding
Agentic coding is using an AI tool that plans and executes a whole task in your codebase rather than completing one line at a time.
- Coding agent
A coding agent is an AI system that carries out programming tasks end to end: reading a codebase, editing multiple files, running commands, and reacting to the output.