Skip to content

Cheatsheet: Server-side tools and built-ins

CategoryWho executesSchema you authorExamples
Server toolsAnthropicJust type identifierweb_search, web_fetch, code_execution
Anthropic-schema client toolsYouAnthropic publishes schemabash, computer use, memory, text_editor
Tool infrastructureAnthropicMixedtool_search, MCP connector (L6)

Decision: who owns the capability + who runs the code?

ToolType identifierPricingZDR
web_searchweb_search_20260209 (dynamic filtering) / web_search_20250305 (basic)$10 / 1,000 searches ($0.01 each)Basic: eligible. Dynamic filtering: NOT eligible
web_fetchweb_fetch_20260209 (dynamic filtering) / web_fetch_20250910 (basic)Standard tokens (no per-fetch charge)Basic: eligible. Dynamic filtering: NOT eligible
code_executioncode_execution_20260120 / code_execution_20250825FREE when used with web_search_20260209 or web_fetch_20260209; otherwise standard per-execution pricingNOT eligible

The canonical case: search plus computation with one tool declared. Dynamic filtering runs code internally:

tools=[{"type": "web_search_20260209", "name": "web_search"}]

If the task also needs top-level code execution beyond filtering search results (plotting, file writes, a calculation independent of search), declare both. The per-execution charge stays waived because web_search_20260209 is in the request:

tools=[
{"type": "web_search_20260209", "name": "web_search"},
{"type": "code_execution_20260120", "name": "code_execution"},
]

Computation only with no search or fetch: declare code_execution_20260120 alone and pay standard per-execution pricing.

ParamUse for
max_usesCap searches per request (cost guardrail)
allowed_domainsWhitelist sources
blocked_domainsBlacklist sources
user_locationLocalize results (approximate; city/region/country/timezone)

Citations: always on; web_search_result_location blocks with url / title / encrypted_index / up to 150 chars of cited_text. Display to end users per docs.

ToolWhat it does
bashExecute shell commands
text_editorCreate + edit files
memoryPersist knowledge across conversations
computer use (beta)Screenshots + mouse + keyboard

Same L4 client loop (tool_use → execute → tool_result). Brief tool descriptions OK because the model already knows the canonical tool.

Computer use discipline (the careful section)

Section titled “Computer use discipline (the careful section)”
  • Beta header required: computer-use-2025-11-24 for Opus 4.8 / Opus 4.7 / Opus 4.6 / Sonnet 4.6 / Opus 4.5; earlier header for older models.
  • ZDR eligible. State-of-the-art on WebArena.
  • Sandbox the environment: VM, container, or isolated profile with minimum credentials. Never against real desktop or production-reachable systems. Treat the agent like a contractor with access only to what they need.
  • Track 20 (“AI Agents and Tool Use”) goes deeper on agent-design at track-level depth.
tools = [
{"type": "tool_search_tool_regex_20251119", "name": "tool_search_tool_regex"},
{"name": "get_weather", "description": "...", "input_schema": {...}, "defer_loading": True},
{"name": "search_files", "description": "...", "input_schema": {...}, "defer_loading": True},
# ...many more deferred tools
]
VariantQuery type
tool_search_tool_regex_20251119Python re.search patterns (max 200 chars)
tool_search_tool_bm25_20251119Natural-language queries
Use whenSkip when
tool_search10+ tools / >10k definition tokens / selection accuracy issues / MCP with 200+ tools<10 tools / all-used-frequently / <100-token total
  • Max 10,000 tools in catalog. Returns 3-5 per search.
  • tool_search tool itself NEVER has defer_loading: true.
  • Keep 3-5 most-used tools non-deferred.
  • Preserves prompt caching (deferred tools not in system-prompt prefix).
{
"role": "assistant",
"content": [
{ "type": "text", "text": "I'll search." },
{ "type": "server_tool_use", "id": "srvtoolu_...", "name": "web_search",
"input": { "query": "..." } },
{ "type": "web_search_tool_result", "tool_use_id": "srvtoolu_...",
"content": [ /* search results */ ] },
{ "type": "text", "text": "Based on...", "citations": [...] }
],
"stop_reason": "end_turn"
}
  • 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.
  • Iterate response.content, surface text + citations.
  • stop_reason typically end_turn. Mid-loop: pause_turn (send back as assistant turn, re-call to continue).
Total cost per call = standard tokens
+ per-tool fees
+ server-tool results in context (as input tokens on next turns)
Dials to manage:
• Declare web_search_20260209 (or web_fetch_20260209) → code-execution per-execution charge is waived
• max_uses on web_search → cap runaway
• Cache stable tool definitions (L7) → drop repeated tool overhead
• tool_search for large catalogs → keep most defs out of context
• Eval-set discipline (L3 + Track 21 L7) → measure tool earns its cost
ToolZDR
web_search (basic: web_search_20250305)Eligible
web_search (dynamic filtering: web_search_20260209)NOT eligible
web_fetch (basic: web_fetch_20250910)Eligible
web_fetch (dynamic filtering: web_fetch_20260209)NOT eligible
code_executionNOT eligible
computer useEligible
bash / text_editor / memoryStandard messages-API ZDR
tool_searchEligible
FailureRecognize byFix
Building your own web searchWasted effort on solved problemDrop in web_search server tool
Paying standalone code_execution when search or fetch is also in flightSurprise per-execution chargesDeclare web_search_20260209 or web_fetch_20260209 in the same request (per-execution charge is waived)
Computer use against real envReal-world side effectsSandbox: VM / container / isolated profile
tool_search below thresholdComplexity without benefitStandard tool calling for <10 tools
Skipping citationsUX miss + docs-recommended disciplineAlways display web_search citations to end users
Ignoring per-tool ZDRCompliance gapCheck the table above before declaring

What this lesson does NOT cover (and where to find it)

Section titled “What this lesson does NOT cover (and where to find it)”
TopicLands at
Model Context Protocol (cross-provider tools)Lesson 6
Prompt caching on tool definitionsLesson 7
The agent loop (model + tools across many turns; pause_turn in prod)Lesson 8 onward
Subagents and Claude Managed AgentsLesson 11
Advisor server tool (research preview)Beyond T22; see docs
  • Anthropic public Claude docs: Web search, Code execution, Web fetch, Computer use, Tool search, Server tools at https://platform.claude.com/docs/en/agents-and-tools/tool-use/. Structural-mirror citation; see references.