AI
Function Calling
Function calling (also called tool use) is a capability that lets a language model, given a description of available functions and their parameters, output a structured request to invoke one of those functions with specific argument values — which the surrounding application then executes and returns the result of.
The model itself never executes anything — it only outputs a structured description of what it wants to happen. The calling application is responsible for actually running the function, handling errors, and feeding the result back to the model so it can incorporate it into its response. This separation is a deliberate safety boundary.
Function calling is the foundational mechanism underneath agentic AI systems and most real-world integrations: without it, a model can only describe an action in prose; with it, an application can reliably parse the model's intent and connect it to real systems like databases, calendars or APIs.
Example
Given a get_weather(city) function description, a model asked "what's the weather in Lisbon?" outputs a structured call to get_weather with city set to "Lisbon" rather than guessing an answer from its training data.