In short.
Pydantic AI's Web Fetch guide helps Python developers give AI agents access to URL contents, but support for models without built-in fetching requires explicit fallback configuration. It documents native-only WebFetch(), the bundled fallback enabled through local=True, custom local tools and domain controls. The page provides configuration examples, but does not establish provider coverage, costs or observed runtime behavior.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete selected page at [https://pydantic.dev/docs/ai/capabilities/web-fetch/index.md]. The page also includes a documentation-index link and a notice requesting intent, stack and harness query parameters while excluding private information. Linked API references, provider-support details and other documentation are excluded. No code was executed; runtime fetching, compatibility, constraint enforcement and output quality remain unassessed.
The overview
Identity
This documentation page explains WebFetch, a Pydantic AI capability that lets an agent retrieve URL contents. The original page is [https://pydantic.dev/docs/ai/capabilities/web-fetch/index.md]. It is a focused feature guide rather than a complete application tutorial.
Assessment
The guide is useful for choosing between provider-native fetching and an explicitly configured local fallback. Its strongest practical detail is that WebFetch() defaults to native-only operation and raises on models without native web fetch. A complete integration still needs information from other documentation, particularly provider support and agent configuration.
Users
The material suits Python developers building Pydantic AI agents that need to read known URLs. Beginners get short configuration examples, while experienced developers get options for native-tool control and custom local implementations. The page assumes familiarity with agent tools and does not explain how to build or invoke a complete agent.
Capabilities
WebFetch prefers the provider's native web fetch tool. Developers can enable a bundled markdownify-based local fallback or provide a callable, Tool or AbstractToolset as the local implementation.
The listed native constraint fields are allowed_domains, blocked_domains, max_uses, enable_citations and max_content_tokens. Only max_uses requires native support. Domain filters are enforced locally when native fetching is unavailable or cannot apply those filters.
Using it
Requirements
The examples import WebFetch from pydantic_ai.capabilities. Default operation requires a model with native web-fetch support. The bundled local fallback requires the web-fetch optional dependency group, identified as pydantic-ai-slim[web-fetch].
Python and Pydantic AI version requirements, supported provider lists, credentials and deployment requirements are not supplied. Requirements for a custom local implementation are also unspecified.
Mechanism
WebFetch provides a common configuration interface that prefers native fetching and can use a configured local implementation on other models. Its native side is backed by WebFetchTool; passing native=WebFetchTool(...) gives direct control over that tool.
The page gives Gemini's URL context as an example of a native web fetch that applies none of the domain filters; in that case, and when native fetching is unavailable, domain filters are enforced locally. Whether Gemini applies the other native constraint fields is not stated clearly on this page. It does not explain fallback after a native request fails, or the detailed behavior of citations and content limits across implementations.
Setup
Import WebFetch from pydantic_ai.capabilities. Choose WebFetch() for native-only operation, or WebFetch(local=True) to prefer native fetching while allowing the bundled local fallback. The latter requires pydantic-ai-slim[web-fetch].
For domain restrictions, the page demonstrates passing allowed_domains alongside local=True. It does not show dependency-installation commands, how to attach the capability to an agent, or model configuration.
Example
The documented restricted-domain example is WebFetch(allowed_domains=['example.com'], local=True). It configures an allowed-domain filter and permits the bundled local fallback while retaining native preference.
This is a configuration example, with example.com as the illustrative domain. The page supplies no agent invocation, fetched content or observed result. Nothing was executed for this report.
Assessment & evidence
Limitations
Local fallback is opt-in, and max_uses requires native support. The provider-support reference is linked but its contents are outside this page, so compatibility with a particular provider or model is unknown.
The page does not establish handling of JavaScript-rendered pages, authenticated sites, redirects, timeouts or retries. Fetch quality, domain-filter enforcement, citation output and performance were not assessed.
Reasoning
For an agent that may use several providers, a shared capability with an explicit local fallback could reduce provider-specific configuration. That is an inference from the documented design, not a measured portability result.
The practical choice depends on whether the chosen model supports native fetching and whether the application needs controls available on that path. The page gives enough detail to identify those decisions, but not to establish production reliability.
Alternatives
Within the documented capability, developers can use native-only operation, enable the bundled local fallback, or supply a custom callable, Tool or AbstractToolset. Native behavior can also be configured through native=WebFetchTool(...).
The page does not compare external fetching libraries or other agent frameworks, so their relative suitability is unknown.
Evidence
The evidence is the complete captured page at [https://pydantic.dev/docs/ai/capabilities/web-fetch/index.md], retained as selected-page.txt with a recorded size of 2,989 bytes. Its source revision is sha256:98a5fb1a8d489af33d60fdc5c95681a5374eb788f0e64a2cdcb3046b17383397.
The page supports descriptions of configuration and intended behavior. It contains no execution logs, fetched responses or benchmark results.
Access & freshness
Costs
Costs are unknown. The page gives no library pricing, provider tool charges, model-token rates or local hosting estimates. It does not establish whether either fetching path is cheaper for a particular workload.
Rights
The selected page supplies no license terms for the documentation, example snippets or underlying library. Redistribution permissions are therefore unknown from this evidence. It also does not establish rights to reuse content fetched from third-party websites.
Freshness
The page was captured on 15 November 2026 at 09:03:55.049 UTC. That timestamp identifies the capture, not the publication or last update. The page states no Pydantic AI release version or revision date, so applicability to a specific installed release is unknown.
Actions
Before adopting the examples, consult the linked native-tool documentation for the chosen provider and confirm that the installed Pydantic AI release exposes this API. Decide whether native-only operation meets the application's needs or whether to configure the bundled or a custom local fallback.
For the bundled fallback, add the web-fetch optional dependency group. Verify the required domain controls and fetching behavior against representative target URLs in the intended environment.
