Tools & agents

Tool Use

Also known as: function calling

When an AI model can call external functions, search, code, a calculator, an API, to do things it cannot reliably do with text alone.

Choose your level

Tool use is when an AI does not just answer from memory but actually reaches for the right tool, a calculator for maths, a search engine for current facts, your calendar to book a meeting. Just like a person grabs a hammer instead of using their fist, a model with tools can do far more, and far more reliably, than one that can only write text.

Tool use (often called function calling) lets a language model trigger an external action instead of only generating words. The model is told which tools exist and what inputs they need; when useful, it outputs a structured request to call one, the application runs it, and the result is fed back so the model can continue.

Why it matters

  • Accuracy: offload maths, lookups and data access to systems built for them, reducing hallucination.
  • Reach: send email, query a database, run code, control other software.
  • Freshness: get current information the model was never trained on.

Tool use is the mechanism that turns a chatbot into an AI agent, and standards like the Model Context Protocol give models a uniform way to discover and call tools.

Tool use exposes a set of typed function signatures to the model, which learns (through training and prompting) to emit a structured call, name plus JSON arguments, when a step is better handled externally. The runtime executes the call and returns the observation into the context window, enabling an interleaved reason-act loop (ReAct-style). It is the primitive underneath agents: retrieval, code execution, web browsing and API access are all just tools.

Design considerations dominate reliability: tools should be well-scoped, idempotent where possible, and clearly described; argument validation and error handling matter because models can emit malformed or unsafe calls; and side-effecting or irreversible actions warrant confirmation gates. Interoperability layers such as MCP standardise tool discovery and invocation across applications, while retrieval is often implemented as one specialised tool among many.

← Back to the glossary

What are you looking for?