Skip to main content

Anthropic Server-side Tools

Claude's exclusive "server-side tools" mechanism — tools are executed on Anthropic's backend, and the response directly returns result blocks and citations. The client does not need to orchestrate the tool call → tool result → model re-invocation loop itself. All other providers' tool use requires the client to execute the tool and return a tool_result.

Currently Available Server-side Tools

Tool TypeFieldPurpose
web_search_20250305tools[*].typeAnthropic backend automatically performs web search and injects results as citations

Additional server-side tools added to the platform in the future will be listed here as well.

Supported Endpoints and Models

  • Endpoints: v1/messages (Anthropic native protocol, recommended) / v1/chat/completions (passthrough)
  • Supported models: Refer to the Server-side Tools / Web Search labels in Model Catalog → Claude.

Trigger Parameters

tools Array, each item in the form:
{
"type": "web_search_20250305",
"name": "web_search",
"max_uses": <int, maximum number of calls per request>
}

Response Structure (v1/messages)

When a server-side tool is triggered, the following blocks appear in order in the response content[] array:

  1. server_tool_use — a record of the tool call made on behalf of the client by the platform
  2. web_search_tool_result — the result returned by the tool (including a list of search results)
  3. A text block with a citations field — the final answer synthesized by the model based on the results, with each cited passage traceable to a specific source in web_search_tool_result
{
"content": [
{
"type": "server_tool_use",
"id": "srvtoolu_xxx",
"name": "web_search",
"input": {"query": "today's Shanghai Composite Index closing price"}
},
{
"type": "web_search_tool_result",
"tool_use_id": "srvtoolu_xxx",
"content": [
{"type": "web_search_result", "url": "...", "title": "...", "encrypted_content": "..."}
]
},
{
"type": "text",
"text": "According to ... reports, ...",
"citations": [
{"type": "web_search_result_location", "url": "...", "title": "...", "cited_text": "..."}
]
}
]
}

Example

curl $TURING_BASE_URL/messages \
-H "Authorization: Bearer $TURING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "turing/claude-sonnet-5",
"max_tokens": 4096,
"messages": [{"role": "user", "content": "What is today'\''s Shanghai Composite Index closing price?"}],
"tools": [{
"type": "web_search_20250305",
"name": "web_search",
"max_uses": 3
}]
}'

Billing

  • web_search_20250305 call count is recorded in usage.server_tool_use.web_search_requests; the platform charges $10 / 1K requests
  • The text block in the response (model-synthesized answer) is billed at the standard output token rate
  • Search results in web_search_tool_result are counted as input tokens (if these blocks are retained in messages in subsequent turns, they will be billed again)

Comparison with Client-side Tool Use

DimensionClient-side (tools + function)Server-side (tools[*].type: web_search_20250305)
Who executes the toolClient codeAnthropic backend
Multi-turn orchestrationClient must receive tool_use → return tool_resultCompleted within a single request; no multi-turn required
Tool scopeAny custom functionOnly Anthropic-provided built-in server tools
CitationsCustomAutomatic citations field
EndpointsBoth protocols supportedBoth protocols supported, but v1/messages fields are more native

Notes

  • Retaining server tool blocks across turns: Keeping server_tool_use / web_search_tool_result blocks in the messages of subsequent turns allows the model to refer back to previous search results; however, these blocks count toward input tokens.
  • Cost control with max_uses: This is a hard cap on the maximum number of searches within a single request. Once exceeded, further calls are stopped and the results obtained so far are returned.
  • Protocol differences: Under the v1/chat/completions protocol, server tool fields are also passed through, but the content block structure in the response will be flattened into a string and citations information may be lost. Use v1/messages for the full citations experience.