Learn AI /AI Agents and Automation /Function calling
Function calling
- Intermediate
- AI Agents and Automation
- Technical readers
Also called: structured tool call.
Back to the milestone you came from
In five seconds
What it is
A method that lets a model return a structured request for an external tool or system instead of only producing free-form text.
In plain words
It is a way for an AI system to ask software tools for help using a neat, fixed form instead of messy text.
An everyday example
You ask for a drink in ordinary language. The cashier enters a structured order with fixed choices such as size, temperature and milk type. The till rejects combinations the café cannot make, checks that payment is complete and sends the valid ticket to the kitchen. The kitchen prepares the drink and returns it. The cashier interpreted the request, but did not gain unrestricted control of the kitchen.
In the story, the officer deliberately fills the form. In function calling, the model generates the structured request from text patterns, so the structure may still be wrong or incomplete. Also, real systems can chain several tool calls automatically, while the clerk example suggests only one simple handoff.
Remember thisFunction calling lets a model propose a schema-constrained tool request. Separate software must validate, authorise and execute that request before anything happens.
Understand it
Understand it
Why it matters
For non-specialists, this term matters because it affects what an AI system can actually do, how safely it does it, and where responsibility sits. A system that uses function calling can move from chat to action: searching databases, creating tickets, checking stock, or drafting a query for another system. That can save time, but it also creates new failure points. The model may select the wrong tool, fill arguments badly, or produce a well-formed request that still makes little sense. Good systems therefore add validation, permissions, logging and human review. If you are buying, governing or using AI tools, this term helps you ask better questions: What tools can it call? Who approves execution? What data leaves the system? Can we audit each action?
From user request to tool result
Show that function calling separates three roles: the model formats a tool request, the application decides whether to run it, and the tool returns data.
01
1. User asks
A person asks for something that may need outside data or an action, such as searching documents or checking a calendar.
Draw a box labelled 'User request' with example text beneath in smaller type.
02
2. Tools are described
The application provides the model with tool names and allowed fields, such as query, date_range or location.
Draw a box labelled 'Tool definitions + schema' with a small brace icon and key-value field examples.
03
3. Model returns a structured call
Instead of only prose, the model outputs a machine-readable request naming a tool and its arguments.
Draw a box labelled 'Structured tool call' showing a compact JSON-like shape with tool name and arguments.
04
4. Application validates and runs
Software outside the model checks permissions, required fields and safety rules, then calls the real tool if allowed.
Draw a box labelled 'Application layer' with a checkmark and a gate icon before a smaller box labelled 'Tool/API'.
05
5. Result comes back
The tool returns data. The application may pass that result back to the model to draft a final human-readable answer.
Draw a final box labelled 'Tool result / final answer' with two stacked outputs: raw data and summarised response.
A left-to-right step diagram with five boxes. Read from the user request, to tool definitions given to the model, to the model’s structured call, to application validation and execution, and finally to the returned result or final answer. Arrows show that the model does not directly operate the tool; the application layer does.
On hover or tap, each step reveals one short example: request text, schema fields, structured call, validation rule, and returned result.
Describe this without the diagram
The diagram explains a five-step process. First, a user makes a request that may need outside information. Second, the system gives the model descriptions of available tools and the required argument structure. Third, the model outputs a structured tool call, not direct tool execution. Fourth, an application layer checks the request against rules and then calls the external tool or API if allowed. Fifth, the tool returns data, and the system may convert that into a final answer. The key point is that the model proposes the call, but separate software controls execution.
With reduced motion: A static five-step horizontal diagram with numbered boxes and arrows. No animation; all examples are visible at once under each step.
Function calling lets a language model produce a structured request that software can parse. Instead of replying only with prose, the model can name a tool and supply arguments, such as fields for a search or calendar request.
The input usually includes the user’s request, available tools and a schema. A schema defines details such as field names, types and required values. The model may answer directly or generate one or more structured tool requests. Those requests can still be wrong or incomplete.
An application layer parses and validates each request, then decides whether to run it. The model does not execute the tool by itself. External code, under human-designed rules, runs the tool, collects the result and may send it back to the model for another step.
Tool use is the broader act of using a tool. An API is an interface a tool may expose. A connector links systems, while Model Context Protocol provides a shared interface for tools and data. Function calling is specifically the model’s structured output requesting a call.
How “Ordering through a café till” maps onto the real thing
| In the story | In the AI system |
|---|---|
| The standard request slip with fixed boxes | The structured schema for tool arguments |
| The policy officer’s need for archive results | The user request that may require a tool |
| The records clerk checking the slip | The application validating the model’s tool call |
| The archive system returning documents | The external tool or API producing output |
A worked example
Before close of business, a desk officer needs the latest cleared talking points on digital inclusion from the document repository for a front office meeting.
Starting from: The request plus a search_records tool with typed fields for document_type, topic, clearance_status, language and limit.
- The application sends the request and the tool specification to the model.
- The model returns a structured call with document_type set to talking points, topic set to digital inclusion, clearance_status set to cleared, language set to English and limit set to three.
- The orchestration layer validates the field types, confirms that the repository and records are within the desk officer’s permissions, and rejects or requests correction if any argument is invalid.
- The repository search runs and returns matching records with titles, clearance status, dates and file links.
- The model presents the records in date order and identifies the most recent one, without inventing content that was not returned by the repository.
Result: The desk officer receives a short, traceable list of cleared records and can open the source file before sending it to the front office. Execution remains with the application, not the model.
In a United Nations workplace
At a liaison office town hall, a human resources officer gets an unanticipated question about the form and clearance route for a flexible working request. An approved internal assistant can turn the question into a structured call to the office’s guidance register, with fields for request type, duty station and document status, then retrieve the current form and instructions.
The model proposes the lookup, but the orchestration layer checks the fields, the officer’s access and the permitted data source before running it. This is faster than searching several folders while the town hall waits, and more controlled than letting the model improvise an answer from memory.
Before you try thisThe tool call is a retrieval request, not an eligibility decision or approval. The officer must verify that the returned guidance is current. Staff names, medical details, performance information or other personal circumstances must not be entered into a tool that has not been approved for such data.
Where you may hear it
- A vendor demo for an approved internal assistant
- An ICT governance board reviewing tool permissions
- A procurement unit meeting on system integration
- A design session for automating document clearance
Avoid confusion
Avoid confusion
Often confused with
Tool use
A system uses external software or devices during a task to look up information, calculate, carry out actions or control equipment beyond its own processing.
API
An application programming interface defines rules that software uses to request data or actions from another system.
Connector
A connector links an AI system or app to another digital service so it can send requests, receive results, and use them in a task.
Model Context Protocol
A standard way for an AI application to connect with external tools and data sources through a shared, predictable interface.
Common misconceptions
Common misconception: Function calling means the model can directly run software functions on its own.
Correction: Usually the model only outputs a structured request. Separate application code decides whether to execute it, with checks for permissions, required fields and safety rules. Without that outer layer, no real tool action happens.
Common misconception: Function calling is the same thing as an API.
Correction: An API is the interface exposed by another system. Function calling is a pattern where the model formats a request so software can use an API or another tool more reliably. One is the external doorway; the other is the model’s structured knock on that doorway.
Common misconception: If the tool call is structured, the result must be correct.
Correction: Correct format is not the same as correct intent. The model may choose the wrong tool, place the wrong value in a field, or omit an important constraint. Validation can catch format problems more easily than reasoning errors.
Quick check
Which statement best describes function calling in an AI system?
The key idea is separation of roles. The model produces a machine-readable request, but external software handles validation, permissions and execution. It is not the same as an API, and it does not mean tools are always used.
Go deeper
Go deeper
The simple version
It is a way for an AI system to ask software tools for help using a neat, fixed form instead of messy text.
The technical version
In practice, function calling means the model is prompted with one or more tool specifications, usually including a name, description and argument schema. The model then generates either plain text or a structured object representing a call, often JSON-like, with typed fields. An orchestration layer parses that object, validates it against the schema, checks policy and permissions, executes the corresponding tool or API if allowed, and returns the tool output to the model or user. This improves reliability over extracting parameters from free text, but it does not guarantee semantic correctness. The important separation is between generation of a call by the model and execution of the call by external software.
Reviewed external resources
Primary sourceModel Context Protocol (opens in a new tab)Model Context Protocol
This official Model Context Protocol material is useful for readers who want to understand a standardised way tools and context can be described to models and applications.
Deeperlink checked 2026-07-31
EncyclopaediaWikipedia search: Function calling (opens in a new tab)Wikipedia
This Wikipedia search results page helps readers scan broad background and related terms, and suits people who want a starting point rather than a single authoritative article.
search results, not one pagelink checked 2026-07-31
ArticleBuilding effective agents (opens in a new tab)Anthropic
This article gives a practical view of agents and likely situates tool use and action in larger systems, which suits readers designing or evaluating agent behaviour.
Intermediatelink checked 2026-07-31
VideoVideo explanations: Function calling (opens in a new tab)YouTube search
This YouTube search results page helps visual learners find multiple video explanations and demos, and it suits readers who prefer walkthroughs over text.
search results, not one pagelink checked 2026-07-31
DiscussionCommunity discussion: Function calling (opens in a new tab)Reddit search
This Reddit search results page surfaces community questions, implementation issues and informal comparisons, which suits readers who want to see common confusions and practitioner discussion.
search results, not one pagelink checked 2026-07-31
Where this came from
Drafted with a language model through an offline pipeline, checked against this site's schema, and every external link above fetched to see whether it answers. Treat it as a starting point and check anything that matters against the primary sources. How this site is built and what that means.
The one thing to remember
Function calling lets a model propose a schema-constrained tool request. Separate software must validate, authorise and execute that request before anything happens.