Agents
Function calling
A structured mechanism by which a large language model returns a call to a developer-defined function with arguments instead of text, which the application then executes.
Function calling is a structured mechanism by which a large language model produces a call to a developer-defined function — together with its arguments — instead of plain text. It is how a model connects to external systems such as APIs, databases, or code execution.
The developer supplies a list of functions; each has a name, a description, and a parameter schema (typically JSON Schema). The model decides whether a call is needed and returns a structured request: the function name and JSON-encoded arguments. The application runs the function and feeds the result back to the model, which then continues reasoning or composes a final answer. A “strict mode” guarantees that the emitted arguments conform exactly to the declared schema.
Function calling is the technical foundation of the broader practice of tool use and the basis of every AI agent. In 2025–2026 it became a standard capability of leading models, while protocols such as MCP standardize how functions and tools are exposed to the model.