Reasoning & Agents

Function Calling

Let a model invoke your APIs with structured arguments

Reasoning Text Advanced Growing
Capability type
Reasoning
Modality
Text
Typical input
User intent + function schemas
Typical output
Structured call arguments
Measured by
Tool-selection accuracy

Overview

Function calling (also called tool use) lets a model translate an intent into a structured call against an API you define. The model does not execute anything itself; it returns a name and validated arguments, and your code decides whether to run it.

How it works

You supply a schema for each available function. The model decides whether a call is needed, which function fits, and emits JSON arguments matching the schema. Your application executes it and returns the result, which the model uses to compose its reply.

Use cases

In-app assistants

Let users say what they want and have the app perform it through existing endpoints.

SaaS

Data lookups

Fetch live order, account or inventory data mid-conversation.

E-commerce

Structured extraction

Force output into a strict schema for reliable downstream processing.

Data

Multi-system actions

Chain calls across CRM, billing and messaging from one instruction.

Operations

Benefits

  • Turns natural language into reliable, typed API calls.
  • Keeps execution and authorisation on your side of the boundary.
  • Makes assistants genuinely useful rather than conversational only.
  • Schema validation catches malformed calls before they run.

Limitations

  • Models sometimes pick the wrong tool or invent parameter values.
  • Too many available functions degrades selection accuracy.
  • Every exposed function widens your security surface.
  • Schemas and descriptions need real maintenance as APIs evolve.

What to look for when choosing a tool

  • Strict JSON-schema validation on arguments
  • Parallel and sequential call support
  • Confirmation flow for irreversible actions
  • Per-function authorisation on your side
  • Observability into which tools get called and why

FAQ

Does the model execute my functions itself?
No. It returns the intended function name and arguments; your code validates and runs them. That boundary is what lets you enforce authorisation and rate limits.
How many functions can I expose at once?
Accuracy falls as the list grows. Group related functions, or retrieve a relevant subset per request rather than sending your entire API surface every time.
What stops it calling something destructive?
You do. Require confirmation for irreversible actions, scope credentials tightly, and never expose a delete endpoint without a human approval step in front of it.