Function calling is the ability of a language model to request execution of a predefined external function with structured arguments, instead of trying to answer from its own parameters alone.
Function calling lets a developer describe external tools as schemas. When the model determines a tool is needed, it returns a structured call with the tool name and arguments. The application executes the function and feeds the result back to the model for the next step.
That single capability turns chat models into agents. The model does not need to know how to query a database, call an API, or run code. It only needs to recognize when those actions are useful and emit a correctly structured request. The application owns execution, retries, and error handling.
Think of it like this. Think of a concierge who cannot open doors or run errands directly, but can write precise instructions for staff who can. The concierge decides what is needed; the staff execute it.
The developer registers functions with JSON schemas describing names, parameters, and descriptions. At inference, the model may return a special structured response requesting one of those functions. The application validates the arguments, executes the function, and appends the result to the conversation. The model then continues with the new information.
"Function calling is built into the model." The schema and execution are application responsibilities. "More tools is better." Too many tools confuse tool selection and raise latency. "The model validates arguments." Schemas guide generation; runtime code must still validate inputs.
Enables reliable external actions, but requires disciplined schema design and robust execution wrappers. Great for structured workflows; risky when tool descriptions are ambiguous or side effects are irreversible.