AI CompendiumA public chart of the language
Home / Tools & Environment / Function Calling
Tools & Environment

Function Calling

also called Tool use, Function calling API

The model-provider feature that makes structured tool calls reliable.

Definition

An API mode where you declare available functions and the model returns a structured call rather than prose. It is what turns "the model wrote JSON in a sentence" into an actual integration.

Function calling is the mechanism behind tool use. The model still only emits text — the difference is that the text is guaranteed to match the schema you declared, so your code can parse it safely.

The historical significance is worth keeping in view: this feature replaced an era of asking models to emit JSON in prose and parsing it with regexes that broke weekly. Once the provider guarantees the shape, tool use became ordinary software engineering.

How people use it
Replacing fragile string parsing.
"Stop regexing JSON out of the reply. Declare the function and let the API give you typed arguments."
Worked example

From parsing prose to receiving a schema

Extracting structured data from an email.

The old approach scraped JSON out of a paragraph and failed on malformed output. Declaring a schema and letting the API return a validated call removes the failure mode entirely rather than reducing its frequency.

Sources
  • docsFunction calling ↗OpenAI API docs · 2026

    The application-managed tool cycle spelled out: define the function with a JSON Schema, receive the call, execute it yourself, return the output.

  • docsFunction calling ↗Google Cloud Vertex AI docs · 2026

    The model selects a declared function and supplies arguments. Useful as a cross-vendor reference showing the pattern is not one provider’s design.

  • paperToolformer: language models can teach themselves to use tools ↗Schick et al. (arXiv) · 2023

    Self-supervised learning of when to call an API, which one, with what arguments, and how to use the result — tool use as a learned behaviour rather than a prompt trick.

Related terms