Instead of just generating text responses, LLMs can understand when to call specific functions and provide the necessary parameters to execute real-world actions.
Illustration of how models call external functions via structured JSON (via Superface.ai Blog
Function calling is a mechanism that lets a language model like GPT or Claude invoke external functions or APIs — in a structured and secure way.
Instead of producing free-form output, the model returns a JSON object specifying which function to call and with what arguments. A developer (or orchestrator) can then execute the function and optionally feed the result back into the model.
This enables agents that can:
Function calling makes LLMs interactive, not just informative. It turns the model from a passive predictor into a decision-making orchestrator of tools.
{
"name": "getWeather",
"arguments": { "location": "Tokyo" }
}
getWeather("Tokyo")
and optionally feeds the result backIt’s the basis for modern agent systems, plugin platforms, and automation flows.