Expand description
web_search: search the web and return the top results as numbered sources.
Three modes serve the web_search built-in (WebSearchSetting):
- native: a provider server tool on the model itself (Anthropic
web_search, the OpenAI Responsesweb_searchtool, Bedrock Mantle’s GPT models), with no harness tool. The tool records for those areanthropic_web_search_tool,openai_web_search_toolandbedrock_mantle_web_search_tool; - AgentCore (features
bedrockormantle): on Bedrock models without native search, themake_agent_core_web_searchtool built here, backed by Amazon Bedrock AgentCore’sInvokeWebSearchAPI and authorized by IAM; - Exa (opt-in, feature
mcp): theweb_search_toolbuilt here, backed by Exa’s hosted MCP server, a third party that receives the queries. The keyless tier works out of the box andEXA_API_KEYlifts its rate limit.
The tool/backend split (search_tool over a SearchBackend) keeps the model-facing
contract fixed while the provider behind it can change.
Structs§
- Agent
Core Backend - The search backend over AgentCore web search (
agentCoreBackend). A missing permission, missing credentials, or an unsupported region is permanent, so it is remembered (and logged once) and later searches fail without a request. - ExaBackend
- The search backend over Exa’s hosted MCP server. Each search opens its own MCP session and closes it.
- Make
Agent Core WebSearch Options - Options for
make_agent_core_web_search(MakeAgentCoreWebSearchOptions). - Search
Result - One search result (
SearchResult). - WebSearch
Error - A backend failure with a message the model can act on (
WebSearchError).
Enums§
- WebSearch
Setting - The
web_searchbuilt-in setting (WebSearchSetting): on (native search where the model has it), off, or Exa on any model. JSON form:true,falseor"exa".
Constants§
- WEB_
SEARCH_ DESCRIPTION - The
web_searchtool description.
Traits§
- Search
Backend - Runs a search (
SearchBackend): the topmax_resultsresults forquery.
Functions§
- anthropic_
web_ search_ tool - The Anthropic server tool record for native search (
ANTHROPIC_WEB_SEARCH), forAnthropicModelConfiganthropic_tools. - bedrock_
mantle_ web_ search_ tool - The Bedrock Mantle (GPT models) built-in tool for native search, for the model’s
params.tools. - make_
agent_ core_ web_ search - Builds a
web_searchtool over Amazon Bedrock AgentCore web search (makeAgentCoreWebSearch). The credentials needbedrock-agentcore:InvokeWebSearch. - openai_
web_ search_ tool - The OpenAI Responses built-in tool for native search, for the model’s
params.tools. - search_
tool - Builds a
web_searchtool that formatsbackend’s results as a numberedSources:list.max_resultsis clamped to 1-10 (5 when omitted); failures and empty results come back as text. - web_
search_ tool - The
web_searchtool served by Exa;EXA_API_KEYis read on every call. The harness builds it whenweb_searchis set toWebSearchSetting::Exa.