---
description: A web_fetch tool with automatic Markdown conversion and adapters for Pi Durable, AI SDK, and TanStack AI.
title: New web_fetch tool in the Agents SDK for reading webpages and documents, with automatic markdown conversion
image: https://developers.cloudflare.com/changelog/post/2026-10-11-web-fetch/og.png?v=446f91b9abc89cbd
---

[Skip to content](#main-content)

[View RSS feeds](https://developers.cloudflare.com/fundamentals/new-features/available-rss-feeds/) [ Subscribe to RSS](https://developers.cloudflare.com/changelog/rss/index.xml)

[Back to all posts](https://developers.cloudflare.com/changelog)

October 12, 2026

## New web\_fetch tool in the Agents SDK for reading webpages and documents, with automatic markdown conversion

[Agents](https://developers.cloudflare.com/agents/)

Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/changelog/post/2026-10-11-web-fetch/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

The [Cloudflare Agents SDK](https://developers.cloudflare.com/agents/) now provides a `web_fetch` tool that reads webpages, PDFs, and supported Office documents, using [Workers AI Markdown Conversion](https://developers.cloudflare.com/workers-ai/features/markdown-conversion/) to turn them into text the model can read. The tool requests Markdown directly from sites that support [Markdown for Agents](https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/) and formats JSON for the model.

When you give the `web_fetch` tool to your agent, the model provides a URL and receives back the page content, along with the final URL, HTTP status, and content type. Long pages come back in smaller sections, with an offset the model can use to continue reading. You control which hosts the agent can fetch, response size, timeouts, and redirects.

When you also provide the [`web_search`](https://developers.cloudflare.com/agents/tools/web-search/) tool to your agent, the model is told to use `web_fetch` to read the pages that `web_search` returns.

To use the `web_fetch` tool, make sure you have [Agents SDK v0.28.0 ↗︎](https://github.com/cloudflare/agents/releases/tag/agents%400.28.0) or greater installed, and add it to a [Pi Durable](https://developers.cloudflare.com/agents/harnesses/pi/) [extension registry](https://developers.cloudflare.com/agents/harnesses/pi/extensions/) before opening the harness:

```js
import { webFetchTool } from "agents/webfetch/pi";

export class MyAgent extends DurableObject {
	// ...

	harness = new PiHarness({
		harness: async ({ storage, context }) => {
			this.registry.install({
				name: "web-tools",
				tools: [webFetchTool({ binding: this.env.AI })],
			});

			// ...

			return Harness.open(
				storage,
				{ models, registry: this.registry },
				context,
			);
		},
	});
}
```

```ts
import { webFetchTool } from "agents/webfetch/pi";

export class MyAgent extends DurableObject<Env> {
	// ...

	readonly harness = new PiHarness({
		harness: async ({ storage, context }) => {
			this.registry.install({
				name: "web-tools",
				tools: [webFetchTool({ binding: this.env.AI })],
			});

			// ...

			return Harness.open(
				storage,
				{ models, registry: this.registry },
				context,
			);
		},
	});
}
```

The `web_fetch` tool works with any harness. The SDK includes AI SDK and TanStack AI adapters. If you use a different harness, or need to fetch a page without calling a model, use `fetchWeb()`, `windowWebFetchPage()`, and `renderWebFetchPage()` from `agents/webfetch`. Direct fetching does not require a Durable Object or browser.

For setup, examples, and request controls, refer to [Web fetch](https://developers.cloudflare.com/agents/tools/web-fetch/).

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://developers.cloudflare.com/changelog/post/2026-10-11-web-fetch/#page","headline":"New web_fetch tool in the Agents SDK for reading webpages and documents, with automatic markdown conversion","description":"A web_fetch tool with automatic Markdown conversion and adapters for Pi Durable, AI SDK, and TanStack AI.","url":"https://developers.cloudflare.com/changelog/post/2026-10-11-web-fetch/","inLanguage":"en","image":"https://developers.cloudflare.com/changelog/post/2026-10-11-web-fetch/og.png?v=446f91b9abc89cbd","dateModified":"2026-10-12","datePublished":"2026-10-12","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```
