Server-Side Tools
Some providers (Anthropic, OpenAI) offer built-in tools like web search that execute server-side — the provider runs them, not your code. Bind them the same way as local tools; results come back as server_tool_result content blocks.
Quick Reference
- →Anthropic: bind_tools([{'type': 'web_search_20250305', 'name': 'web_search'}])
- →OpenAI: bind_tools([{'type': 'web_search_preview'}])
- →Results appear as server_tool_result blocks in response.content_blocks
- →No local execution — the provider fetches results on its infrastructure
- →Server-side tools can be mixed with local @tool functions in the same bind_tools() call
What Server-Side Tools Are
Most tools run client-side — your code executes them and passes the result back to the model. Server-side tools are different: they're built into the provider's infrastructure. When the model decides to call web_search, the provider fetches and processes the results itself before returning the final response. You never see the raw tool call/result cycle — just the model's answer, enriched with live data.
Anthropic offers web_search as a server-side tool. OpenAI offers web_search_preview. These are different tools with different billing, rate limits, and result formats. They are not interchangeable across providers.