Function calling is when an AI model, instead of only writing text, replies with a structured request to run a piece of software, such as “look up the weather for Paris”. Your app runs it and hands the result back, and the model uses that result in its answer. It is also called tool calling.
Picture a manager who cannot leave the office but has an assistant. The manager writes a slip: “Check stock of item 42 in the warehouse.” The assistant goes, checks, and brings back the number. The manager then tells the customer. The AI is the manager writing slips; your app is the assistant who actually does the job.
In a sentence: “With function calling, the travel bot does not guess train times; it asks our timetable system and reads out what comes back.”
Is function calling the same as tool use?
The plain point: mostly yes; vendors use the two names for the same mechanism.
| Term | How it relates |
|---|---|
| Tool use | Same idea: Anthropic’s name for it. Function calling is the name OpenAI and Google lead with. |
| API | Differs: the door a program offers to other programs. Function calling is how a model asks your app to use one. |
| MCP | Differs: a shared standard for plugging tools into AI apps. The model still calls the tools through function calling. |
| Plugin | Differs: a ready-made add-on for an app. Function calling is the lower-level mechanism a plugin may use. |
OpenAI’s guide opens with both names: “Function calling (also known as tool calling) provides a powerful and flexible way for OpenAI models” to reach outside systems and data.1 Anthropic’s says the reverse: “Tool use (also called function calling) lets Claude call functions that you define or that Anthropic provides.”2 Google’s Gemini guide puts it in one line: “Function calling lets you connect models to external tools and APIs.”3
How does function calling work, step by step?
The plain point: the model writes the request, your code does the work, and the model writes the final answer.
OpenAI lays out five steps.4 In plain words:
- You describe the tools. Your app tells the model which functions exist, what each does and what details it needs, for example “get_weather needs a city”.
- The model asks. If the question needs a tool, the model replies with the function’s name and the details filled in, instead of a normal answer.
- Your app runs it. Your code calls the weather service, the database or the calculator.
- You send the result back. The output goes to the model in a second request.
- The model answers, or asks for another tool if it needs more.
The key detail: the model never runs anything itself. Google’s guide says so plainly: “The model doesn’t execute the function itself.”5 One nuance: some vendors also offer tools they run for you. Anthropic calls these server tools, such as web search, while the functions you define run in your own app.6
Function calling turns a model from something that only talks into something that can get things done, but the doing happens in your code. Whatever the model asks for, your app decides whether to run it.
Why it matters to you
The plain point: it is the joint that lets chatbots check live facts and lets agents act.
Google lists three jobs it is for: to augment knowledge, extend capabilities and take actions.5 When a chatbot checks a live flight or an AI agent books a meeting, function calling is usually what happens underneath.
It also brings risks. A model can fill in details you never gave it: Anthropic notes that when a required detail is missing, Claude “might guess values you didn’t supply”.6 In this site’s reading, that is why actions that spend money, send messages or delete things should need a person’s yes first; see human-in-the-loop and permission tiers for agents.
Questions people ask
Does the AI run the function itself?
No, not for functions you define. The model returns the name and the details, and your application runs it, as Google’s guide states: “The model doesn’t execute the function itself.”5
Can a model call more than one function at once?
Yes, on some platforms. Google’s guide describes calling several functions at once when they are independent, and chaining calls for more complex requests.5
How do you stop the model sending badly formed requests?
Use the vendor’s strict mode if it has one. OpenAI says setting strict to true makes function calls “reliably adhere to the function schema, instead of being best effort”; see structured output.4
Where to go next
- The same idea, Anthropic’s name: what is tool use in AI?
- Exact formats for the request: what is structured output?
- Plugging tools in once: what is MCP?
- What it makes possible: what is an AI agent? and AI agents for beginners.
- Keeping it safe: permission tiers for agents.
QUICK CHECK · 3 QUESTIONS
Pick an answer to see if you got it. Nothing is recorded.
1. In function calling, who actually runs the function you defined?
- The AI model runs it inside itself
- Your application runs it and sends the result back
- The user runs it by hand
Show the answer
Answer: Your application runs it and sends the result back. The model only writes the request; your app runs the function and returns the result.
2. How does function calling relate to tool use?
- They are mostly the same mechanism under two names
- Tool use is for images and function calling is for text
- Function calling replaced tool use
Show the answer
Answer: They are mostly the same mechanism under two names. OpenAI and Google lead with function calling; Anthropic calls the same thing tool use.
3. Why should actions like sending messages or spending money need a person’s approval?
- Because function calling only works with approval
- Because vendors charge more without it
- Because a model can fill in details you never gave it
Show the answer
Answer: Because a model can fill in details you never gave it. Anthropic notes a model may guess missing values, so risky actions are worth a person’s yes.
Related terms: Coding agent · Embedding · Eval · Human-in-the-loop · MCP (Model Context Protocol) · Multi-agent system
- 1OpenAI, Function calling, OpenAI API documentation, read at source 19 Oct 2026“Function calling (also known as tool calling) provides a powerful and flexible way for OpenAI models” (the sentence goes on to interfacing with external systems and data outside the training data). ↑
- 2Anthropic, Tool use with Claude, Claude API documentation, read at source 19 Oct 2026“Tool use (also called function calling) lets Claude call functions that you define or that Anthropic provides.” ↑
- 3Google AI for Developers, Function calling with the Gemini API, Gemini API documentation, read at source 19 Oct 2026“Function calling lets you connect models to external tools and APIs.” ↑
- 4OpenAI, Function calling, read at source 19 Oct 2026“Make a request to the model with tools it could call”; “Receive a tool call from the model”; “Execute code on the application side with input from the tool call”; “Make a second request to the model with the tool output”; “Receive a final response from the model (or more tool calls)”. ↑a“Setting strict to true will ensure function calls reliably adhere to the function schema, instead of being best effort.” ↑b
- 5Google AI for Developers, Function calling with the Gemini API, read at source 19 Oct 2026“The model doesn’t execute the function itself. Extract the name and args and execute in your application.” ↑alists use cases under “Augment Knowledge:”, “Extend Capabilities:” and “Take Actions:”. ↑b“The model doesn’t execute the function itself.” ↑c“Call multiple functions at once when they are independent” and “Chain multiple function calls together for complex requests”. ↑d
- 6Anthropic, Tool use with Claude, read at source 19 Oct 2026“It then returns a structured call that your application executes (client tools) or that Anthropic executes (server tools).” ↑a“Claude (particularly Claude Sonnet) might guess values you didn’t supply”. ↑b
The comparisons and examples on this page (the manager and the assistant, the travel bot, the five plain-word steps) are this site’s own ways of explaining, not claims from these sources.
Free printable AI cheat sheets, and AI news every week.
Sixteen one-page AI guides and checklists in one free PDF, no sign-up. And if you want to keep up, the newsletter covers what changed in AI each week, in plain English, with the sources.
SUBSCRIBE FREE ↗ GET THE CHEAT SHEET PACK