Using AI tools

Tool use

In short

Tool use, also called function calling, is when an AI model asks to run an outside tool, such as a web search, calculator or company database, and then uses the result in its answer. Usually the app, not the model, runs the tool.

Also called
Function calling, Tool calling, Tool-augmented language models
Topic
Using AI tools
Level
Some background helps
First described
Parisi, Zhao and Fiedel described tool-augmented language models (TALM) in May 20224. Schick and colleagues' Toolformer followed in February 20233.

A language model on its own can only produce text. Tool use lets it reach beyond that. A developer describes the tools on offer, each with a name, a plain-language description and a schema setting out its inputs1. When a request needs one, the model replies with a structured call naming the tool and the arguments to pass, instead of a final answer12.

The model does not run anything itself. OpenAI sets out the loop: the app sends a request listing the tools, the model returns a tool call, the app runs the code, sends the output back, and the model either answers or calls more tools2. Anthropic calls tools that run in the developer's own software "client tools". Its "server tools", such as web search and code execution, run on Anthropic's systems instead1. Anthropic also publishes ready-made tools for running shell commands, editing files and controlling a computer's mouse and keyboard1.

Research came first. Google researchers described tool-augmented language models (TALM) in May 20224. Meta's Toolformer, posted in February 2023, showed a model teaching itself which tools to call, when, and with what arguments, using a calculator, a question-answering system, two search engines, a translator and a calendar3.

Tools are not free. On Claude, tool definitions count as input tokens, and server tools such as web search carry their own usage charges1. Chaining many tool calls together is what turns a chatbot into an AI agent.

Example

You ask a rail app's assistant, "Is my 08:15 to Leeds on time?" The model cannot know, so it returns a call to a train-status tool with the service details. The app looks up live data, passes back "delayed 12 minutes", and the model writes the reply.

Why it matters

It is what lets AI tools look things up and take actions rather than only talk. Most AI agents, coding assistants and chatbots that search the web rely on it.

Questions people ask

Is tool use the same as function calling?

Yes. Anthropic says tool use is "also called function calling"1, and OpenAI calls its version function calling, also known as tool calling2.

Does the AI run the tool itself?

Usually not. The model sends back a request naming the tool and its inputs, and the developer's application runs it and returns the result2. Some providers run certain tools on their own servers, such as Anthropic's web search and code execution tools1.

Does tool use cost extra?

On Claude, tool names, descriptions and schemas are billed as input tokens, and the API adds a small hidden system prompt when tools are present. Server tools like web search carry an extra charge per use1.

Related terms

Tools that use it

Sources

  1. Anthropic, Claude API documentation, Tool use with Claude
  2. OpenAI API documentation, Function calling guide
  3. Schick et al. (2023), Toolformer: Language Models Can Teach Themselves to Use Tools, arXiv:2302.04761
  4. Parisi, Zhao and Fiedel (2022), TALM: Tool Augmented Language Models, arXiv:2205.12255

Back to the glossary