WebFetchTool for retrieving content from a specific URL, and WebSearchTool for running a web search query. Both tools require permission — by default, Claude will ask you to approve each domain or search the first time it is used.
WebFetchTool
Fetches content from a URL and returns it to Claude, converting the response to the requested format (markdown by default).Parameters
The URL to fetch. Must be a valid URL. HTTP URLs are automatically upgraded to HTTPS.
A description of what Claude should extract or summarize from the fetched content. The tool applies a lightweight extraction step to focus the result on what you asked for rather than returning the raw page.
How it works
- Claude sends an HTTPS request to the URL.
- The response body is converted to markdown (stripping HTML tags and formatting).
- If
promptis provided, a lightweight summarization step focuses the content on the relevant parts. - The result is returned to Claude as a tool result, capped at 100,000 characters.
Redirect handling
If the URL redirects to a different host,WebFetchTool returns a redirect notice instead of following it automatically. The notice includes the redirect URL so Claude can make a second call with the correct address.
Supported content types
| Content type | Handling |
|---|---|
| HTML pages | Converted to markdown; scripts and styles removed |
| Markdown files | Returned as-is for pre-approved hosts |
| PDFs and binary files | Saved to a temporary file on disk; path included in the result |
Permission model
The first time Claude tries to fetch from a domain, it asks for your approval. You can pre-approve domains in your local settings:Example
WebSearchTool
Searches the web using Anthropic’s built-in search capability and returns results with titles, URLs, and a synthesized summary.WebSearchTool is available on Anthropic’s first-party API (claude.ai) and on Vertex AI with Claude 4.0+ models. It is not available on Amazon Bedrock or with older model versions.Parameters
The search query. Must be at least 2 characters.
When provided, only return results from these domains. Cannot be used together with
blocked_domains.When provided, exclude results from these domains. Cannot be used together with
allowed_domains.How it works
WebSearchTool delegates to Anthropic’s server-side web search capability, which runs up to 8 searches internally. The results — titles, URLs, and synthesized commentary — are returned as a structured result. Claude is required to include source links in its response when using web search results.
Use cases
- Looking up documentation for a library or API.
- Finding the current version of a package.
- Researching error messages or known issues.
- Checking whether a feature is available in a specific version.
Example
Domain filtering example
Permission model
WebSearchTool requires explicit permission the first time it is used. You can pre-approve it in your local settings: