Function Calling
conceptA provider-specific API feature that lets models output structured calls to predefined functions.
Function calling is the mechanism by which LLM APIs expose tool use. When you send a request to an LLM API, you include a list of function definitions (name, description, parameters as JSON Schema). The model can then respond with a function call instead of — or alongside — text.
OpenAI introduced function calling in June 2023, and it quickly became a standard pattern. Anthropic, Google, and other providers followed with their own implementations. The key challenge is reliability: models must output valid JSON matching the schema, choose the right function, and know when not to call any function at all.
Function calling is the foundation of agent tool use, enabling everything from web search to code execution to database queries.