A mechanism for language models to invoke external functions or APIs by producing structured outputs that trigger tool execution.
Also known as: API calling, tool calling, tool use
In plain English
Function Calling lets a smart assistant do things for you, not just give answers — like pressing a button in another app. When you ask it to act, it formats the request so a program can run the task. That means the assistant can complete actions such as booking or fetching information.
In practice
Function Calling is the feature that allows an LLM to call backend APIs or tools with structured arguments instead of free-form text, improving reliability and parseability. It matters because it enables automated workflows, clearer logging, and stricter validation of model-driven actions, so teams can safely integrate AI into production systems. When buying tools, practitioners evaluate schema flexibility, error handling and security controls around function execution.
Under the hood
The model is provided with function signatures or JSON schemas and is prompted to emit a structured token sequence (often JSON) selecting a function and its arguments. The host parses that output, validates and executes the corresponding API or function, then returns the result to the model for further processing. Key concepts include schema design, deterministic decoding, tool routing, grounding to reduce hallucination, and secure execution/validation.
Example
"Enable function calling so the model can query our inventory API and return structured product data for the frontend."