WebSearchTool
Searches the web and returns results with titles, URLs, and a synthesized summary. Claude Code performs the search using Claude’s built-in web search capability—no external API key is required.Parameters
The search query. Minimum 2 characters.
Restrict results to only these domains. Cannot be combined with
blocked_domains.Exclude results from these domains. Cannot be combined with
allowed_domains.Returns
The original query, an array of search results (each containing titles and URLs) interleaved with text commentary synthesized from the results, and the duration of the search operation in seconds.Example
Searching for recent information about a library:WebSearchTool is available when using Claude Code with the Anthropic API (first-party), Vertex AI with Claude 4.0+ models, or Foundry. It is not available with all API providers or model versions.
WebFetchTool
Fetches content from a URL and processes it into a readable format. Useful for retrieving documentation, API references, changelogs, and other web content during a task.Parameters
The URL to fetch. Must be a valid URL. HTTP URLs are automatically upgraded to HTTPS.
Instructions describing what to extract or summarize from the fetched content. The tool applies this prompt to the page content using a fast model before returning the result, keeping only the information relevant to your request.
Returns
An object containing:result— the processed content as a string, based on yourpromptcode— the HTTP response status codecodeText— the HTTP status text (e.g."OK")bytes— the size of the fetched content in bytesurl— the URL that was fetcheddurationMs— time taken to fetch and process the content in milliseconds
Example
Fetching the changelog for a specific package version:If the URL redirects to a different host, the tool returns details about the redirect rather than following it automatically. Make a second WebFetchTool call with the redirect URL to retrieve the final content.