Function Calling
Definition
Function calling is a capability of large language model APIs that allows a model to signal, in a structured and machine-parseable way, that it wants to invoke a specific external function or tool, including the name of the function and the arguments to pass to it. Rather than returning a natural language description of an action, the model returns a structured object that the calling application can use to execute a real function—querying a database, calling an external API, performing a calculation—and then return the result to the model for incorporation into its response.
Function calling is the foundational mechanism that transforms LLMs from conversational interfaces into agents capable of taking real-world actions. In commerce applications, function calling enables AI assistants to look up live inventory, retrieve customer order history, apply discount codes, check shipping status, or trigger workflows in downstream systems—all within a natural language conversation. It also makes model behavior more reliable and auditable compared to parsing actions from free-form text, because the model must commit to a specific function name and argument structure that the application validates before execution. Designing safe agentic systems requires careful attention to which functions are exposed, what authorization controls govern their invocation, and how errors are handled when function calls fail.
Related Terms
Source
Last updated: May 12, 2026