Home/Glossary/Function Calling
Technical

Function Calling

A model feature that allows it to request the execution of developer-defined functions with structured arguments.

Full Definition

Function calling (also called tool calling) lets developers define a set of functions — with names, descriptions, and parameter schemas — and pass them to the model. When the model determines that a function is needed to answer the user, it outputs a structured JSON call with the function name and arguments rather than a prose answer. The developer executes the function and returns the result to the model, which then uses it to form a final response. This enables LLMs to take actions — searching the web, reading files, querying databases, calling APIs — making them practical for agentic applications. OpenAI popularised the feature; Anthropic calls it 'tool use'.

Examples

1

Defining a get_weather(city: str, unit: str) function; the model calls it with {'city': 'London', 'unit': 'celsius'} when asked about London's weather.

2

An AI assistant using function calling to fetch a user's calendar events, then summarising the week's schedule in natural language.

Apply this in your prompts

PromptITIN automatically uses techniques like Function Calling to build better prompts for you.

✦ Try it free

Related Terms

Tool Use

The ability of a model to invoke external tools — APIs, code executors, search —

View →

Agent

An AI system that autonomously plans and executes multi-step tasks using tools a

View →

Structured Output

Constraining model generation to produce valid, machine-parseable formats like J

View →
← Browse all 100 terms