Skip to main content

Overview

The web fetch tool retrieves URLs and extracts content as clean Markdown. Purpose-built for reading web pages, articles, and documentation with automatic HTML-to-Markdown conversion.
For API calls with custom methods, headers, or authentication, use the http tool instead.

web_fetch

Fetch a URL and extract its content as clean Markdown. Always uses GET method and automatically converts HTML to readable Markdown. Input Parameters
string
required
HTTPS URL to fetch. Must be a public URL (no localhost or private IPs).
Output
string
Original URL requested
string
Final URL after following redirects (max 3 hops)
integer
HTTP status code
string
Page title extracted from <title> tag (HTML only)
string
Clean Markdown content (HTML converted via Readability)
integer
Number of words in the content
Example
Response

Features

Automatic HTML to Markdown

When fetching HTML pages:
  • Extracts main content using Readability algorithm
  • Removes navigation, ads, footers, and clutter
  • Converts to clean Markdown format
  • Preserves headings, links, lists, and code blocks
  • Falls back to raw HTML if conversion fails

Redirect Following

  • Follows up to 3 redirects automatically
  • Each redirect hop is SSRF-validated
  • Returns final URL after all redirects
  • Relative redirects resolved correctly

Security

All the same security features as the http tool:
  • HTTPS-only: HTTP requests rejected
  • SSRF protection: Localhost and private IPs blocked
  • DNS rebinding defense: All resolved IPs validated
  • Cloud metadata blocked: 169.254.169.254 rejected
  • Leak detection: URLs scanned for secrets
  • Size limits: 5MB maximum response size

Approval

Web fetch is always auto-approved. The SSRF and leak protections are unconditional, and reading public web pages doesn’t require confirmation.
Approval requirement: Never

Rate Limiting

  • 30 calls per minute
  • 500 calls per hour

Error Conditions

  • Missing or invalid URL
  • HTTP URL (not HTTPS)
  • Localhost or private IP address
  • Hostname resolves to disallowed IP
  • Outbound leak detected (secrets in URL)
  • Network error
  • Failed to read response body
  • Request exceeded 30 second timeout
  • Too many redirects (max 3)
  • Redirect missing Location header
  • Response Content-Length exceeds 5MB
  • Response body exceeds 5MB during streaming

Examples

Documentation Page

Response:

Blog Article

GitHub README

Comparison with HTTP Tool

Use Cases

Reading Documentation

Fetch API docs, library documentation, or technical articles:

Research

Gather information from multiple sources:

Content Extraction

Extract clean content from blog posts or news articles:

Technical Details

User Agent

Requests use a Chrome-like User-Agent to avoid bot detection:

Accept Header

Prefers Markdown but accepts HTML:

Title Extraction

Extracts <title> tag from HTML using ASCII-safe case-folding to handle Unicode correctly.

Content Type Detection

HTML conversion triggered when Content-Type header contains text/html.