Skip to content

Summary: Server-side tools and built-ins

The other half of L4’s client-vs-server distinction. Three categories of Anthropic-provided tools. (1) Server tools (Anthropic executes; no round-trip in your code): web_search at $0.01 per search with always-on citations (two versions: web_search_20260209 with dynamic filtering, web_search_20250305 without), web_fetch for retrieving a specific URL’s full content, code_execution that runs sandboxed Python and bash and is free when used with web_search_20260209 or web_fetch_20260209 in the same request (dynamic filtering uses code execution internally; declare code_execution_20260120 alongside only when the task needs top-level code execution beyond filtering). (2) Anthropic-schema client tools (you execute, schema is standard): bash, computer use (beta, requires the computer-use-2025-11-24 header), memory, text_editor. The L4 client-tool loop applies; advantage over a custom client tool is the model already knows what these tools do. Computer use is the high-stakes one: run it in a sandboxed environment (VM, container, isolated profile), never against your real desktop or any system that can reach production. (3) Tool infrastructure: tool_search keeps catalogs of up to 10,000 tools efficient by deferring loading; mark each tool with defer_loading: true; the model finds 3-5 relevant ones per call. Two variants (regex, BM25). Right above ~10 tools; wrong below. Server response shape differs from client tools: server_tool_use + the matching tool-specific result block (web_search_tool_result, code_execution_tool_result, web_fetch_tool_result, tool_search_tool_result) inline in the same response (no round-trip in your code); stop_reason typically end_turn (or pause_turn mid-loop, re-call to continue). Pricing stacks: standard tokens + per-tool fees + server-tool results in context. Lesson 6 (MCP) extends the same pattern to cross-provider tools; lesson 7 (caching) makes the cost sustainable; lesson 8 onward turns one round-trip into the agent loop.

  • Three tool categories. Server tools (Anthropic executes: web_search, web_fetch, code_execution). Anthropic-schema client tools (you execute, schema is standard: bash, computer use, memory, text_editor). Tool infrastructure (tool_search, MCP connector for lesson 6).
  • web_search: $10 / 1,000 searches. web_search_20260209 with dynamic filtering (code execution runs internally to filter results; no need to declare code_execution_20260120 separately); web_search_20250305 without. Optional max_uses / allowed_domains / blocked_domains / user_location. Citations always on.
  • code_execution is free when web_search_20260209 or web_fetch_20260209 is in the same request. Standalone code_execution_20260120 carries the standard per-execution pricing. Not ZDR-eligible regardless.
  • web_fetch retrieves a specific URL’s full content (different from web_search). Two versions (web_fetch_20260209 with dynamic filtering, web_fetch_20250910 basic); same pricing rule for code_execution applies.
  • Anthropic-schema client tools (bash / text_editor / memory / computer use) use the L4 client-tool loop; the canonical schema means brief tool descriptions. Treat like contractors: minimum credentials, isolated environment.
  • Computer use is beta + powerful + high-stakes. Header required (computer-use-2025-11-24 for current 4.x models). Sandbox the environment (VM, container, isolated profile). Track 20 for deeper agent-design treatment.
  • tool_search for scale: 10,000-tool catalog limit; defer_loading: true on each deferred tool; model finds 3-5 per search. Variants tool_search_tool_regex_20251119 (precise) and tool_search_tool_bm25_20251119 (natural language). Right above 10 tools; wrong below.
  • Server response shape: server_tool_use + the matching tool-specific result block (web_search_tool_result, code_execution_tool_result, web_fetch_tool_result, tool_search_tool_result) inline; no round-trip in your code. stop_reason typically end_turn; pause_turn mid-loop, re-call to continue.
  • Pricing stack: standard tokens (per model from L3) + per-tool fees + server-tool results in context. Dials: declare web_search_20260209 (or web_fetch_20260209) to waive the code-execution per-execution charge; max_uses caps runaway; cache stable tool definitions (L7); tool_search keeps large catalogs out of context.
  • ZDR eligibility varies by tool. web_search / web_fetch eligible (except with dynamic filtering); computer use eligible; code_execution NOT eligible. Check per tool if your organization has data-retention requirements.

Before this lesson, every tool was something you built (the L4 custom-client path). After this lesson, you have three lanes: don’t build what Anthropic already provides as a server tool (web_search, web_fetch, code_execution); reach for Anthropic-schema client tools when the capability is yours to run but the schema is standard (bash, computer use, memory, text_editor); and reach for tool_search when your tool catalog grows past 10 entries. The single highest-leverage change this week: audit your existing or planned tool list against the server-tool catalog; if you have a search-the-web tool or a run-Python tool or a fetch-a-URL tool, replace it with the corresponding Anthropic server tool and stop maintaining your own. The free-when-used-with pricing rule (declare web_search_20260209 or web_fetch_20260209 and the code_execution per-execution charge is waived) is the second-most-leveraged move; it cuts a real bill to zero for the common “search and compute” pattern. Computer use is the one to treat with care: sandbox the environment from day one; the worst-case for an under-isolated agent is a real production outage. Lesson 6 (Model Context Protocol) opens the same pattern to tools that live outside Anthropic’s catalog; lesson 7 (prompt caching) makes the cost sustainable; lessons 8-11 turn these tools into multi-step agents.