Skip to content
Sign in

What is Function Calling?

Function calling lets large language models request the execution of external tools or functions by outputting structured data (usually JSON) instead of plain text.

The model is first given a list of available functions along with their names, descriptions, and expected parameters. When a user query requires external data or action, the model responds with a function call object rather than a normal answer.

The calling application then executes the requested function, returns the result to the model, and the model incorporates that result into its final response. This loop can repeat for multi-step tasks.

It turns a language model into the reasoning core of an agent that can safely interact with APIs, databases, or other software.

Example

A user asks "What's the weather in Paris?" The model outputs a structured call to a get_weather function with the argument city="Paris". The app runs the function, feeds the temperature back to the model, and the model replies with the current conditions.

Why it matters

Function calling is the key mechanism that lets today's LLMs move beyond chat to reliably control tools and become autonomous agents in real applications.

Frequently asked questions

Yes, the terms are often used interchangeably; function calling is the specific technique most LLM providers use to implement tool use.