Function Calling
definition
Function calling is the mechanism through which language models invoke external tools by outputting structured requests that match predefined function signatures. Rather than generating free-text descriptions of what they want to do, models produce structured JSON payloads specifying the function name and arguments — which the host application then routes to the actual implementation.
Function calling is the mechanism through which language models invoke external tools by outputting structured requests that match predefined function signatures. Rather than generating free-text descriptions of what they want to do, models produce structured JSON payloads specifying the function name and arguments — which the host application then routes to the actual implementation. This structured interface is what transforms a language model from a text generator into an agent capable of taking real-world actions like reading files, querying databases, or calling APIs. The reliability of function calling depends heavily on the quality of tool definitions: clear names, precise descriptions, and well-typed parameters with constraints make the difference between an agent that reliably selects the right tool and one that constantly misroutes. This concept connects to JSON schema for the underlying format of tool definitions, tool definition patterns for best practices, and MCP server primitives for how function calling is standardized across the protocol layer.