Rendered Source Note

Anthropic — Tool Use (Function Calling) Overview

Generated HTML view. Markdown remains canonical.

Anthropic — Tool Use (Function Calling) Overview

Type: official-doc Tier: 1 (Official Doc) Author(s): Anthropic Date: Accessed 2026-06-01 URL: https://platform.claude.com/docs/en/docs/build-with-claude/tool-use/overview Accessed: 2026-06-01

Why This Source Matters

This is the primary source for tool use — the central learning target of Project 06. Tool use is how an LLM stops being a text-in/text-out function and starts acting: reading a file, searching a codebase, calling an API. The mechanism is a structured request/response protocol — the model emits a structured call, your code executes it, you feed the result back, and the model continues. That request→execute→feed-back cycle, run in a loop, is the spine of every coding copilot and every agent (Project 08). The lab calls tools through LiteLLM's OpenAI-style interface (tools / tool_calls), but the conceptual flow below — defined by Anthropic's native API — is identical across providers.

Key Claims

Tools are defined by name, description, and an input schema

The request/response flow (client tools)

  1. You send messages plus a tools list to the model.
  2. If the model decides to use a tool, it responds with stop_reason: "tool_use" and one or more tool_use content blocks. Each tool_use block has an id, a name, and an input object (the arguments, matching your schema). Example:

``json { "type": "tool_use", "id": "toolu_01A09q...", "name": "get_weather", "input": { "location": "New York, NY", "unit": "fahrenheit" } } ``

  1. Your code executes the operation and sends the outcome back as a tool_result content block (a user-role message) carrying the matching tool_use_id and the result content.
  2. The model reads the result and either calls another tool or returns a final answer with stop_reason: "end_turn".

The agentic loop

Controlling whether the model calls a tool — tool_choice

Tools as structured output

Missing parameters

Relevant To

Notes