Study · Claude Course

Tool Use

Tools let Claude reach beyond its training data (real-time/current info). Flow: request + tool schemas → Claude emits a **tool-use block** → your code runs the tool → you send a

type conceptstatus activetools · api · agents

tool_result block back → Claude answers.

Key points

  • Schema: name, description (3–4 sentences), input_schema (JSON). Tip: have Claude generate the schema from your function.
  • Message blocks: responses can contain multiple blocks (text + tool_use); append the whole response.content to history. stop_reason == "tool_use" means Claude wants a tool.
  • tool_result goes in a user message: tool_use_id, content (string), is_error.
  • Chaining: a while loop keeps calling Claude until no tool-use blocks remain.
  • Batch tool: run multiple tools in parallel in one assistant message.
  • Structured data via tools: force a call with tool_choice; read response.content[0].input.
  • Built-in tools (text-edit, web-search) ship schemas; web-search runs server-side with citations.

Sources

  • 2026-06-28-claude-course
Compiled from wiki/study/claude-course/Tool-Use.md · git is the source of truth