Definition
Function calling is a model interface for proposing structured calls into application code. The application describes available functions, usually with a name, description, and argument schema. The model returns a selected function and arguments. The application validates that proposal, decides whether it is allowed, executes any approved call, and may return the result to the model for the next step.
The name is slightly misleading: the model does not execute the function. It generates data that asks the surrounding system to do so. That boundary is where authorization, schema validation, sandboxing, timeouts, retries, idempotency, and user confirmation belong.
How the current API pattern spread
OpenAI's June 13, 2023 Chat Completions update introduced functions and function_call parameters that accepted JSON Schema descriptions and returned JSON arguments. The announcement helped establish the current LLM API meaning of function calling. It did not invent functions, remote procedure calls, or model access to external software.
Providers and protocols now use different names and wire formats. "Tool calling" is often the broader term because a tool may represent search, code execution, a user interaction, or another service rather than a local programming-language function.
Operational significance
A valid argument object proves only that the output matches a shape. It does not prove that the function exists in the current environment, that the chosen arguments match user intent, or that the caller has permission. Tool descriptions are also part of the model's context, so their wording, size, ordering, and stability can affect selection.
Treat the model's proposed call as untrusted input. Consequential side effects need an independent policy decision, and ambiguous intent may require confirmation before execution.
Distinguish it from nearby terms
- Structured output constrains the shape of model output but does not require that the output name an executable function.
- Model Context Protocol defines how hosts, clients, and servers expose tools and exchange results. Function calling is the model interaction pattern that may be used inside such a system.
- An API call is the actual request made by software. A model-generated function call is only a proposal until the harness sends or executes something.
Check your understanding
A model emits delete_account(account_id="42") in valid JSON. List the checks the application still needs before any account is changed.