function calling
The capability by which a language model not only writes text but requests the program in a structured format to execute a predefined operation.
In plain terms
A language model alone can only generate text: it cannot access your calendar, know today's exchange rate, or send emails. Function calling breaks down this barrier. The model receives a list of operations it can request, and if needed, it asks for one.
It is like a waiter and a kitchen in a restaurant. The waiter (the model) talks to you, understands what you want, but does not cook. It writes a precise order on a slip, the kitchen (the program) prepares it, and the waiter brings it out and tells you what you received.
It is important that the model itself does not run anything. It only provides a filled-out 'order form': which operation is requested and with what data. Whether this actually happens is decided and executed by the program surrounding it.
This is what turns a chatbot into an agent: function calling is the hand by which the AI reaches from text toward real systems.
How it works
- The developer describes the available tools to the model: their names, purposes and what data they expect (for example: 'query weather', input: city and date).
- You ask a question, and the model decides whether it can answer from memory or needs to use a tool.
- If a tool is needed, the model does not write the final answer but a machine-readable, structured request (typically JSON): the function name and the filled-in data. It can request multiple tools at once.
- The program checks the request, executes the actual operation (queries a database, calls a service), and returns the result to the model.
- Based on the result, the model formulates the answer, or if needed, requests another tool. This allows it to complete tasks consisting of many steps.
An everyday example
You ask an AI assistant whether you need an umbrella in Szeged tomorrow and when the morning train departs from Budapest. The model calls a weather and a schedule query function in the background, then assembles the answer from the fresh data. You only see that the assistant 'looked it up'.
Who is affected
A common misconception
Limits and risks
- The model can make mistakes: it may choose the wrong tool or fill the request with incorrect, even fabricated data, so the input must always be checked.
- If a tool performs irreversible actions (payment, deletion, sending an email), it is advisable to request human approval beforehand.
- Malicious text hidden in a website or email can trick the model into making unwanted tool calls (prompt injection), so grant it only the permissions absolutely necessary.
- Every tool description and every call increases cost and response time, and with too many tools, the model is more likely to get lost.
Similar, but not the same
- Model Context Protocol (MCP) – Function calling is the model's ability to request a tool, while MCP is a standard for how tools can be connected in a unified way to different AI applications.
- structured output – With structured output, the model's final response follows a fixed format, whereas with function calling, the fixed-format request serves to trigger an operation.
- API – The API itself is the service gateway called by programs, while function calling is the way the model signals it wants to use such a gateway.
Related concepts
AI-agent, large language model, tool use
parallel function calling, tool description
Model Context Protocol, structured output, API, prompt injection, agentciklus
A brief history
The term was popularized by OpenAI when it introduced function calling in the GPT models' programming interface in June 2023. Other major model developers quickly followed, typically under the names 'tool use' or 'tool calling'.
Where things stand
By the end of 2026, this is a basic capability of every major language model, and AI agents and assistants are built on it. The focus is already on the standardized connection of tools (for example, MCP) and on secure, controlled execution.
In the news
- AI tool use causes privacy incidents at Washington mental health facilities and Weill Cornell radiologyNov 2, 2026 · Health
- Chinese AI tool used against South Korean banks also hit Japanese companiesOct 18, 2026 · Agent Age
- Chinese Qwen search tool removed from US Federal Register site; Alibaba releases new Qwen image modelSep 17, 2026 · Agent Age
Also known as
function calling · function calling · function calling · tool calling · tool use · tool calling · tool use
Sources
- OpenAI – Function calling (developer documentation)
- OpenAI – Function calling and other API updates (June 2023)
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.