The type of tool. Must be web_search_20250305 for web search
name
string
✅
-
The name of the tool. Use web_search
max_uses
integer
-
-
Maximum number of times the web search tool can be used in a single request, range in 1-10
allowed_domains
array
-
-
Only include search results from these domains. Cannot be used with blocked_domains
blocked_domains
array
-
-
Never include search results from these domains. Cannot be used with allowed_domains
user_location
object
-
-
Localize search results based on user’s location. See User Location
Max Uses StructureThe max_uses parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web_search_tool_result will be an error with the max_uses_exceeded error code.Domain FilteringWhen using domain filters:
Domains should not include the HTTP/HTTPS scheme (use example.com instead of https://example.com)
Subdomains are automatically included (example.com covers docs.example.com)
Specific subdomains restrict results to only that subdomain (docs.example.com returns only results from that subdomain, not from example.com or api.example.com)
Subpaths are supported (example.com/blog)
You can use either allowed_domains or blocked_domains, but not both in the same request
Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console
Tool selection mode. auto: model decides whether to use a tool, any: model must use one of the available tools, tool: model must use the specific tool specified by name.
name
string
-
The name of the specific tool to use. Required only when type is tool.
Thinking mode. enabled: model uses extended thinking for internal reasoning before generating the response, disabled: standard response mode.
budget_tokens
integer
-
Maximum tokens allocated for thinking. Required when type is enabled. The model uses these tokens for internal reasoning before producing the final output.