Tool use (function calling)

Definition

Tool use, also called function calling, is when an AI model asks your software to run a specific action, such as a search or a database lookup, and then uses the result in its answer. The model chooses the tool and the inputs; your code runs it.

By Ronan Liedmeier, fractional head of growth and course author · Published 17 October 2026 · Last updated 17 October 2026

Also called: function calling, tool calling

It is what lets a model check live data or change a record instead of relying on what it learned in training. AI agents are built on it.

How it works

You describe each tool to the model with a name, a short description and an input schema that lists the fields it accepts. When the model decides it needs a tool, it pauses and returns a request with the tool's name and the inputs. Your code runs the action and sends the result back, and the model continues. In Anthropic's API these messages are called tool_use and tool_result. Some tools, such as web search, run on the provider's side, so you only see the result.

The model reads tool descriptions the way it reads a prompt. Anthropic's guide to agents recommends giving tool definitions as much care as the main prompt, with example inputs and clear boundaries between similar tools.

Example

A freelance ops manager gives a model two tools: look up a contact in HubSpot, and create a contact. When a new form submission arrives, the model classifies the inquiry and calls the lookup. It calls "create" only if no match exists, and only after someone clicks approve in Slack.

Common mistake

Every tool on the list is something the model can call. If a tool can delete or send, a line in the prompt won't stop it. Give read tools freely, put an approval step in front of anything that writes, and keep the API keys in a credential store, never in the prompt.

Learn it in AI Academy

Related terms

API (application programming interface)
An API (application programming interface) is a set of requests a software service agrees to accept from other programs, a bit like a menu. A program sends a request such as "create a contact" and the service sends back data or a confirmation.
Agent loop
An agent loop is the repeating cycle an AI agent runs to finish a task: it plans a step, calls a tool, reads the result and decides whether to continue or stop. The loop ends when the goal is met or a limit is reached.
Model Context Protocol (MCP)
Model Context Protocol (MCP) is an open standard that lets AI apps connect to outside tools and data, such as a calendar, a CRM or a database, through one shared format. Apps that support MCP can then use those tools without a custom integration for each one.
Structured output (JSON mode)
Structured output is a way of getting an AI model to return its answer in a fixed, machine-readable format, usually JSON with named fields, instead of free text. It lets another program read the answer reliably, for example to fill a spreadsheet row or pick the next step in a workflow.

Sources

Browse all terms

Find your next step with AI