Without function calling, large language models can only generate text. They can describe what you should do, but they can't do it themselves. Function calling is the technical mechanism that changed this — it lets LLMs output structured instructions that software can execute, transforming text generators into agents that take real actions in the world.
If you're using any AI agent in 2026 — Claude Computer Use, OpenAI Operator, Lindy, Relevance — you're using function calling, even if you don't know it. This guide explains what function calling is, how it works under the hood, and why it matters for understanding what AI agents can and can't do.
The basics: from text to actions
A large language model, at its core, is a text predictor. Given some input text, it predicts what text should come next. This is great for chatbots — the model predicts the next word of its response. But it's limiting if you want the model to take actions. Telling a user "you should send an email to Sarah" is useful; actually sending the email is much more useful.
Function calling bridges this gap. Instead of (or in addition to) generating conversational text, the model outputs structured data that specifies a function to call and the arguments to pass. The surrounding software interprets this output, executes the actual function, and feeds the result back to the model. The model can then decide what to do next based on the function's result.
Without function calling: User asks "what's the weather in Tokyo?" Model responds: "I don't have real-time weather data, but you can check a weather website like weather.com."
With function calling: User asks "what's the weather in Tokyo?" Model outputs: call get_weather(location="Tokyo"). Software executes the function, returns {"temp": 72, "conditions": "sunny"}. Model responds: "It's currently 72°F and sunny in Tokyo."
The difference is dramatic. Without function calling, the model can only talk about the world. With function calling, the model can act on the world — and that's what makes AI agents possible.
How function calling works
Function calling involves four steps, repeated as many times as needed to complete a task:
Step 1: The model is given a list of available functions
Before the model can call a function, it needs to know what functions exist. The developer provides a list of available functions, each with a name, description, and schema (the parameters it accepts). Modern models are trained to understand these schemas and decide which function to call based on the user's request.
Step 2: The model decides to call a function
When the model receives a user request, it decides whether to respond with text or to call a function. If the user asks "send an email to Sarah about the project update," the model recognizes that this requires the send_email function and outputs a structured call specifying the function and its arguments.
Step 3: The software executes the function
The model's output is just structured text — it doesn't actually do anything. The surrounding software parses the function call, executes the actual function (sending the email, querying the database, etc.), and captures the result.
Step 4: The result is fed back to the model
The function's result is returned to the model as part of the conversation. The model can then decide whether the task is complete, whether to call another function, or whether to ask the user for more information. This loop — decide, call, execute, observe — is the agentic loop that defines AI agents.
Why function calling matters
Function calling is the technical foundation that makes AI agents possible. Without it, LLMs are sophisticated text generators — useful for chatbots, writing assistants, and content generation, but unable to take real actions. With function calling, LLMs become the "brains" of agents that can interact with any software system.
Three specific things function calling enables:
- Real-world actions. Sending emails, making purchases, updating databases, controlling devices — anything software can do, an LLM with function calling can do.
- Access to real-time data. LLMs are trained on historical data and don't know what's happening right now. Function calling lets them query live data sources — current weather, stock prices, inventory levels, calendar availability.
- Multi-step workflows. By chaining function calls together (the output of one becomes input to the next), agents can complete complex multi-step tasks that no single function could handle.
Function calling vs MCP
Function calling and MCP (Model Context Protocol) are related but distinct concepts that often get confused:
- Function calling is a capability of the LLM — the ability to output structured instructions for calling functions. It's a model-level feature.
- MCP is a protocol for exposing tools to agents — a standard way for agents to discover and connect to external tools. It's an integration-level standard.
In practice, they work together: MCP exposes tools to the agent, the agent uses function calling to invoke those tools. You need both for a fully functional agent ecosystem.
Limitations of function calling
Function calling is powerful but not magical. Important limitations:
- The model can only call functions it's been given. If a function isn't in the available list, the model can't call it. Agents are limited by what their developers have exposed.
- Function calls can fail. The function might return an error, time out, or produce unexpected results. Good agents handle these failures gracefully; bad agents get stuck.
- Models sometimes call the wrong function. Modern models are good at choosing the right function, but they still make mistakes — especially with similar-looking functions or ambiguous user requests.
- Arguments can be wrong. Even when the model picks the right function, it might pass incorrect arguments (wrong email address, wrong date format, etc.). Verification matters.
Frequently asked questions
Do all LLMs support function calling?
Most modern LLMs (GPT-5, Claude 4, Gemini 3, Llama 4) support function calling as of 2026. Older or smaller models may not. If you're building an agent, function calling support is a baseline requirement — don't use a model that doesn't support it.
Is function calling the same as tool use?
Essentially yes — "function calling" and "tool use" are used interchangeably in most contexts. "Tool use" is the broader concept (the agent's ability to use external tools); "function calling" is the specific technical mechanism that enables it. Some communities prefer one term over the other, but they refer to the same capability.
Can function calling be dangerous?
Yes — function calling is what makes agents capable of causing real-world harm. A misconfigured agent could send inappropriate emails, make unwanted purchases, or delete important data. This is why agent safety matters so much: function calling amplifies both the upside and the downside of AI.
How is function calling different from regular API calls?
Regular API calls are made by software following predetermined logic. Function calling lets the LLM decide which API to call and what arguments to pass, based on the user's natural-language request. The LLM acts as a dynamic decision-maker, choosing the right API call for each situation rather than following a fixed script.
The bottom line
Function calling is the technical mechanism that makes AI agents possible. It's the bridge between "AI that talks" and "AI that acts" — the difference between a chatbot that suggests you send an email and an agent that actually sends it. Understanding function calling helps you understand what agents can do, why they sometimes fail, and what to look for when evaluating agent platforms.
For most users, function calling is invisible — it just works in the background. But knowing it exists helps you ask better questions: "What functions does this agent support?" "What happens when a function call fails?" "Can I add custom functions for my internal tools?" These are the questions that separate thoughtful agent deployment from disappointed expectations.
Want more agent concepts explained?
Our glossary covers 35+ AI agent terms in plain English.
See the glossary