Overview
The Fetch tool retrieves raw content from URLs and returns it in a specified format (text, markdown, or HTML) without any AI processing or interpretation. Use this for simple, fast content retrieval when you need direct access to web resources.The URL to fetch content from. Must start with
http:// or https://The format to return the content in. Options:
text, markdown, or htmlOptional timeout in seconds (max 120). If not specified, uses a default timeout.
Features
- Three output formats - Text, Markdown, or HTML
- Automatic redirects - Handles HTTP redirects transparently
- Fast and lightweight - No AI processing overhead
- Configurable timeout - Prevent hanging on slow sites
- Input validation - Validates parameters before making requests
Usage
Fetch Plain Text Content
Fetch as Markdown
Fetch with Custom Timeout
Format Options
| Format | When to Use | Example Use Case |
|---|---|---|
text | Plain text content or simple API responses | Fetching API status, text files, simple data |
markdown | Content that should be rendered with formatting | Documentation, blog posts, articles |
html | Raw HTML structure needed | Parsing HTML, template analysis |
When to Use
Use the Fetch tool when you need:- Raw, unprocessed content from a URL
- Direct access to API responses or JSON data
- HTML/text/markdown content without interpretation
- Simple, fast content retrieval
- To save tokens by avoiding AI processing
- Extract specific information from a webpage (use specialized extraction tools)
- Answer questions about web content (use agentic tools)
- Analyze or summarize web pages (use agentic tools)
Limitations
- Max response size: 5MB
- Only supports HTTP and HTTPS protocols
- Cannot handle authentication or cookies
- Some websites may block automated requests
- Returns raw content only - no analysis or extraction
- No JavaScript execution (fetches static HTML only)
Tips
- Use
textformat for plain text content or simple API responses - Use
markdownformat for content that should be rendered with formatting - Use
htmlformat when you need the raw HTML structure - Set appropriate timeouts for potentially slow websites
- For authenticated APIs, ensure the endpoint doesn’t require authentication or use appropriate headers
Common Use Cases
Fetching API Data
Reading Documentation
Downloading Configuration Files
Error Handling
Common errors and solutions:- Invalid URL format - Ensure URL starts with
http://orhttps:// - Invalid format - Use one of:
text,markdown,html - Timeout - Increase the timeout value or check network connectivity
- 403 Forbidden - Site may be blocking automated requests
- Response too large - File exceeds 5MB limit
See Also
- Bash Tool - Execute curl/wget commands for advanced use cases
- Grep Tool - Search fetched content
- Write Tool - Save fetched content to files