Glossary

Function calling

Function calling is the mechanism where an LLM emits a structured call — a name plus JSON arguments matching a declared schema — that the runtime then executes.

  • Glossary
  • Updated 2026

Function calling is the contract that lets an LLM ask for code to run. You declare a set of functions — each with a name, a description, and a JSON schema of parameters — and the model responds not with prose but with a precise request: the function to invoke and the arguments to pass. The model proposes; your runtime disposes.

How it works in practice: the declared schemas travel alongside the prompt. When the model determines a function is the right next move, it returns a structured object such as get_weather({ "city": "Berlin" }). The runtime checks those arguments against the schema, executes the real function, and returns the output to the model as a new message. That tight, validated handoff is what makes the behavior dependable rather than a string the model merely hopes is parseable.

Why it matters: function calling is the bridge from free-form language to deterministic software. It is the foundation that tool calling builds on, and the same primitive lets an AI agent query databases, trigger workflows, or chain steps with confidence that each argument is well-formed. For the full picture — schemas, parallel calls, error handling, and patterns — read the complete function calling guide.

Concrete example: a user asks "Book a 30-minute slot tomorrow at 2pm." The model emits create_event({ "title": "Meeting", "start": "2026-06-21T14:00", "minutes": 30 }). The runtime validates the timestamp, calls the calendar API, and feeds back a confirmation the model uses to reply.

Related terms

Concepts that connect to function calling

Tool calling
The broader capability of acting on the world that function calling powers. Read more →
Large language model
The model that produces the structured call from a natural-language request. Read more →
AI agent
A model wrapped in a loop and tools, driven by repeated function calls. Read more →
FAQ

Function calling FAQ

Function calling is the mechanism where a large language model produces a structured call — a function name plus JSON arguments — that matches a schema you declared in advance. The model doesn't run anything itself; it emits the call, and your runtime validates the arguments and executes the corresponding code. The return value is then handed back to the model as the next observation.

Get started

Wire function calling into your agent

Declare a schema, let the model fill it, and execute with confidence. Free to start — no credit card required.