WebFetch for retrieving and analyzing specific URLs, and WebSearch for querying the web when information may be beyond Claude’s training cutoff.
WebFetch
Fetches a URL, converts the HTML to markdown, and then processes the content using a small fast model with a prompt you provide. Returns the model’s response — not the raw page content.Parameters
A fully-formed, valid URL. HTTP URLs are automatically upgraded to HTTPS.
A natural-language prompt describing what to extract or analyze from the page content. The fetched content is passed to a secondary model along with this prompt, and the model’s response is returned.
Behavior
- Claude fetches the URL and converts HTML to markdown.
- The markdown and the
promptare sent to a small, fast model. - That model’s response is returned as the tool result.
WebFetch includes a 15-minute in-memory cache. Repeated calls to the same URL within that window return cached content without a network request.
Redirects
When a URL redirects to a different host, the tool returns a special message indicating the redirect destination rather than following it automatically. Claude then makes a newWebFetch call with the redirect URL.
Limitations
- Read-only — does not submit forms or interact with pages
- Not suitable for pages requiring authentication (login walls, paywalls)
- For GitHub resources, prefer the
ghCLI viaBash(e.g.,gh pr view,gh issue view,gh api)
Example usage
- Extract API details
- Check library version
- Read documentation
WebSearch
Searches the web and returns results including titles, URLs, and a model-synthesized summary. Useful when information may be newer than Claude’s training data.Web search is only available in the United States. It requires a compatible API provider (Anthropic first-party, Vertex AI with Claude 4.0+ models, or Foundry).
Parameters
The search query to execute. Minimum length: 2 characters.
When set, only return results from these domains. Cannot be combined with
blocked_domains in the same request.Example: ["docs.python.org", "peps.python.org"]Exclude results from these domains. Cannot be combined with
allowed_domains in the same request.Example: ["w3schools.com"]Output
The tool returns search results as structured blocks containing:- Result titles and URLs
- A synthesized summary produced by a model that has access to the search results
Sources: section with markdown hyperlinks to its response.
Domain filtering
Restricting to specific domains (allowed_domains)
Restricting to specific domains (allowed_domains)
Use
allowed_domains when you want results exclusively from trusted or authoritative sources:Excluding domains (blocked_domains)
Excluding domains (blocked_domains)
Use
blocked_domains to suppress low-quality or paywalled sources:Search limits
EachWebSearch invocation performs up to 8 individual web searches internally. Claude automatically refines queries as needed within that budget.