Skip to content

Learning path · Tools & MCP · 69

Function Calling

Vendor API pattern where models return named functions with arguments matching predefined schemas for runtime execution.

Why it matters

  • Standard integration path on OpenAI, Anthropic, and others.
  • Enables parallel tool calls on supported models.
  • Non-deterministic JSON serialization affects caching.

Key ideas

  • JSON schema parameters
  • Parallel calls
  • Tool choice modes

Function calling binds model outputs to typed functions your runtime dispatches. Use explicit enums and required fields; optional sprawl confuses smaller models. Handle partial failures when parallel calls return mixed success. Serialize tool definitions in stable order for prompt-cache hits. Log arguments and results for replay debugging. Publish tool latency SLOs separately from model latency; users blame "the AI" when CRM lookups stall for thirty seconds. Ship only after eval gates pass on representative production failures.

Updated 2026-08-09 · Full learning path