Back to glossary

Function Calling

A model capability where the AI generates structured JSON arguments for predefined functions rather than free-form text. Function calling provides a reliable bridge between natural language understanding and programmatic execution.

Function calling is the mechanism that makes tool use reliable at scale. Instead of hoping the model outputs parseable text, you define function schemas with typed parameters, and the model returns structured JSON that your application code can execute directly. Most major model providers including OpenAI, Anthropic, and Google support function calling natively.

For engineering teams building AI-powered products, function calling is the preferred pattern for any workflow where the model needs to trigger backend actions. It eliminates fragile regex parsing, reduces hallucinated outputs, and gives you type safety at the boundary between AI and application logic. When designing functions for your agent, keep schemas simple, use descriptive parameter names, and provide clear descriptions. The quality of your function definitions directly correlates with how reliably the model calls them correctly.

Related Terms