TellWorldAI World Archive

Home›Protocols

Protocol

Function calling (tool calling)

Function calling, now also called tool calling, lets an application describe external functions to a model, which then decides whether to emit JSON arguments for one of them — the route by which models reach data and actions outside their training data.

Era Generative AI for everyone

Release date

What it is

Function calling is a convention that lets an application tell a language model which external operations exist and what arguments each one takes, so that the model can ask for one of them to be run instead of only writing prose [1]. OpenAI introduced the capability on 13 June 2023, alongside updated versions of gpt-4 and gpt-3.5-turbo [1]. In its current documentation OpenAI uses the name tool calling for the same idea, and describes it as the way models reach data and actions outside their training data [2].

Without such a convention an application has to guess what a block of generated text was meant to do. With it, the interface of the program and the output of the model line up: the model fills in a shape the program already knows how to read.

How it works

A developer writes down the available functions and passes them to the model as part of the request; at launch the models involved were gpt-4-0613 and gpt-3.5-turbo-0613 [1]. Each function is described with JSON Schema, a format for stating what a JSON document should look like, so the description carries the function's name and the structure of its arguments [1]. The model reads the user's message and decides for itself whether one of the listed functions fits. If one does, it emits a JSON object of arguments for that function; if none does, it answers in ordinary text [1].

The models were fine-tuned for both halves of that job: recognising when a function should be called, and replying with JSON that follows the function's signature [1]. What the model hands back is the arguments; carrying out the operation is left to the surrounding program. At launch the capability arrived through two new parameters on the /v1/chat/completions endpoint, functions and function_call [1].

Where it came from

It shipped as part of an API update, alongside refreshed model versions, rather than as a separate product [1]. The framing has since broadened: what began as a way to describe functions has become, in OpenAI's documentation, the general route by which a model reaches outside data and actions [2].

What it is used for

OpenAI named three uses at launch: chatbots that answer by calling external tools; turning natural language into API calls or database queries; and extracting structured data out of text [1]. The first two are easy to picture — the model picks a tool and fills in its parameters instead of describing what it would do. The third is quieter: the model reads a document and populates the fields of a function, so the result arrives as data an application can store and compare, not as a paragraph someone has to parse.

All three share one shape. The model handles intent and parameters, and ordinary code does the work.

Two kinds of tools

The documentation separates function tools, defined by a JSON schema, from custom tools that take free-form text as input and return free-form text [2]. When a tool set grows large, tool search can be paired with it so that rarely used tools are loaded only when the model needs them [2].

Risks and limits

The launch post warned that output coming back from a tool cannot be trusted: it may contain text that instructs the model to take unintended actions, and actions with real-world impact should be confirmed with the user first [1]. Two weak points follow from how the mechanism works. The model's choice depends on how clearly the functions are described, and the safety of the whole chain depends on whether tool output is treated as data or as instruction.

CapabilitiesLarge language modelsAgents & tool use

Ecosystem & regionDeveloper tools

Governance & standardsInteroperability

Foundation for1

GPT Actions

Notes and sources

  1. Function calling and other API updateshttps://openai.com/index/function-calling-and-other-api-updates/
  2. Function callinghttps://platform.openai.com/docs/guides/function-calling

Cite this page: Function calling (tool calling). TellWorld, https://www.tellworld.net/protocols/function-calling. Updated 2026-11-07