function calling

Function calling is a model capability in which the model chooses a named function or tool and outputs structured arguments (typically in JSON format) according to a defined schema, so that the application can execute the call and return the results back to the model.

It enables grounded actions and real-time data access by bridging natural language to APIs, databases or utility tools, such as calculators or search.

Providers expose tool or function declarations and schemas. The model decides when and how to call a function, while the host executes the call and returns the output for a final response.

Best practices include providing clear tool descriptions and parameter schemas, validating model-generated arguments, enforcing least-privilege execution, and auditing calls to mitigate security and misuse risks.


By Leodanis Pozo Ramos • Updated Oct. 21, 2025