The Alternatives Issue For tool owners Sign in

Function calling (tool use)

Function calling lets a language model emit a structured request to invoke a developer-defined tool, enabling reliable JSON output and agent workflows.

In more detail

What it means

Function calling (sometimes called tool use) is the API feature where you give the model a JSON schema describing one or more tools, and the model responds with a tool name + arguments instead of free text. OpenAI, Anthropic, Google, and Mistral all support it. It is the foundation of every modern agent loop: the model decides which tool to call, your code runs it, the result is fed back, and the loop continues until the model emits a final answer. Done well, it replaces brittle string parsing and unlocks reliable structured output even when JSON-mode alone fails.

Part 1 of 2

When to use it, and when not

Use it for

  • Any agent or workflow where the model needs to take external action (search, fetch, write to DB).
  • Reliable structured output (more robust than "return JSON" prompting).
  • Multi-step planning with tool routing.

Part 2 of 2

Common mistakes

  • Defining too many tools — models above ~30 tools start mis-routing.
  • Vague descriptions in the schema — the model uses them as docstrings.
  • Not validating the tool arguments against the schema on the server side.

FAQ

Questions readers ask.

What is function calling (tool use)?

Function calling lets a language model emit a structured request to invoke a developer-defined tool, enabling reliable JSON output and agent workflows.

When should you use function calling (tool use)?

Any agent or workflow where the model needs to take external action (search, fetch, write to DB). Reliable structured output (more robust than "return JSON" prompting). Multi-step planning with tool routing.

What are the common mistakes with function calling (tool use)?

Defining too many tools — models above ~30 tools start mis-routing. Vague descriptions in the schema — the model uses them as docstrings. Not validating the tool arguments against the schema on the server side.

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/function-calling.md. Found a mistake? Tell us.