All terms
Agents & toolsUpdated 27 days ago

Function calling / Tool use

Also known as: tool use, tool calling, function tools, function use

Function calling (also called tool use) is the ability of an LLM to reply with a structured JSON call to a function you defined, instead of plain text. Your code runs the function and returns the result, which is how a text model searches the web, queries a database, or calls any API.

What it means

Function calling (also called tool use) is the mechanism that lets a text-only LLM act on the world. You describe a set of functions to the model: a name, what each one does, and a JSON schema for its arguments. When a request needs one of them, the model replies with a structured call such as {"name": "search_web", "arguments": {"query": "..."}} instead of prose. Your runtime executes the call, feeds the result back into the model's context, and the model continues. That loop is the foundation of every AI agent: the model proposes a call, your code runs it, the result goes back into context, and the model decides the next step. Without it, an LLM can only output text. With it, the same model can read your inbox, post to Slack, query Postgres, run shell commands, or click buttons in a browser. The three major APIs ship it under nearly the same name. OpenAI's guide is titled "Function calling" (also known as tool calling), Google's is "Function calling with the Gemini API", and Anthropic's docs open with "Tool use (also called function calling)". Anthropic also runs some tools on its own infrastructure, including web search, web fetch, and code execution, so you do not have to host them. MCP standardizes the layer above, letting one tool server work with any client that speaks the protocol. Two settings matter in production. Strict mode ("strict": true on both OpenAI and Anthropic) makes the arguments match your schema exactly instead of on a best-effort basis. Parallel calls let the model request several functions in one turn, and both APIs let you switch that off when order matters. Current frontier models plan multi-step tool sequences and recover from tool errors well; smaller and older models hallucinate arguments, pick the wrong tool, or loop. Tool design matters as much as model choice: clear names, narrow scopes, and error messages the model can act on.

Example

You give Claude a `get_weather(city)` tool. You ask "should I bring an umbrella to my London meeting?" Claude emits get_weather("London"), your code calls the API and returns "rain", and Claude answers "Yes, bring one. It is raining in London."

Why it matters

Function calling is what turns a chat model into an agent. It is how ChatGPT browses and runs Python, and it is the layer MCP builds on. If you are building anything beyond a Q&A bot, you are building on top of it.

Related terms

See it in a comparison

Recent changes
  • Oct 1, 2026Led with a subject-first "Function calling (also called tool use) is…" definition and put the query term first in the title; replaced the stale Claude 4.x / GPT-5 / Gemini 2.5 model names with a version-agnostic line; added each vendor's documented name for the feature, Anthropic's server-run tools, strict mode and parallel calls.
  • Jun 21, 2026Updated lead sentence to match OpenAI/IBM canonical phrasing ({name, arguments} payload) for AI engine citation.

Get the digest — new glossary terms, skills, and tool updates in your inbox.