All terms

Function Calling

Letting an LLM request structured tool calls — APIs, calculators, databases — instead of only generating free text.

AI Agents1 min read

Definition

Function calling (tool use) exposes named functions with JSON schemas. The model emits a structured call; your runtime executes it and returns results for the model to continue.

It turns chat models into systems that can fetch live data and take actions.

In simple terms

Instead of guessing the weather, the assistant fills out a form that triggers the weather API and then reads the result aloud.

Where you see it

  • Booking assistants calling calendar APIs.
  • Data agents running SQL queries.
  • RAG pipelines invoked as retrieval tools.

How it works

  1. 1.Declare tools

    Name, description, and parameter schema.

  2. 2.Model selects a call

    Structured arguments in the response.

  3. 3.Execute and continue

    Feed tool output back into the conversation.

Why it matters

  • Function calling is the bridge from text generation to useful agents.

Often confused

  • The model executes code by itself.

    Your application runs the function; the model only proposes the call.