Deutsch

Tool use (function calling)

Checked 26 October 2026 · by A.Frick

In shortTool use, also called function calling, lets a model request an outside action, such as a search or a calculation, which an app runs and feeds back.

In plain words

A model alone only writes text. With tool use, you give it a list of tools: a name, a short description and the inputs each one takes. When the model decides it needs one, it does not run anything itself. It writes a structured request, such as "call weather with city = Bern". Your app runs the tool and sends the result back, and the model uses it to write the final answer. OpenAI and Google call this function calling. Anthropic calls it tool use. The pattern is the same.

You ask: Weather in Bern? Model asks for a tool: weather(Bern) Your app runs the tool Model answers using the result 1 2 3 4 The model only writes the request. Your app decides and runs it.
Tool use in four steps.

Some providers also offer tools that run on their side, for example web search. For tools that you define, your own code does the work and keeps control over what happens. A 2023 research paper, Toolformer, showed that models can learn when to call tools such as a calculator or a search engine.

Why it matters

Example

You build a travel assistant with one tool, get_train_times(from, to, date). A user asks: "When is the next train from Bern to Zurich?" The model replies with a tool request. Your app calls a timetable service, gets three departures, and returns them. The model then answers in plain words. The model never touched the timetable service; your app did.

Common misconceptions

Questions and answers

What is the difference between tool use and function calling?

They name the same pattern. The model returns a structured request to call a function, your app runs it and returns the result.

Does the model execute the tool itself?

For tools you define, no. The model only writes the request. Your app runs it. Some providers also run built-in tools, such as web search, on their side.

Is tool use safe?

It is as safe as the limits you set. Validate inputs, give tools the least access they need, and require human approval for risky actions.

Read next

  • AI agent

    An AI agent is a system where a model plans, uses tools and checks results in a loop to reach a goal with little step-by-step guidance.

  • MCP (Model Context Protocol)

    MCP (Model Context Protocol) is an open standard for connecting AI applications to external data, tools and workflows through one shared interface.

  • Prompt injection

    Prompt injection is an attack where text a model reads, such as a web page or file, contains instructions that make it act against its user.

  • Context window

    The context window is the maximum amount of text, counted in tokens, that a model can read and write in one request.

  • Coding agent

    A coding agent is an AI tool that reads a codebase, edits files and runs commands and tests in a loop to finish a programming task.

Sources

  1. Anthropic — Tool use with Claude
  2. OpenAI — Function calling
  3. Google — Function calling (Gemini API)

Was this page helpful?

Ask a question, report an error or suggest a topic

Stored only to answer or improve this page. No newsletter, no sharing. Privacy