Skip to main content
The fetch tool lets agents make HTTP requests to external URLs. The agent can read web pages, call REST APIs, download data, and interact with web services — with support for multiple URLs in a single call.

Configuration

toolsets:
  - type: fetch

Options

timeout
integer
default:"30"
Default request timeout in seconds. Can be overridden per-call by the agent.

Custom timeout

toolsets:
  - type: fetch
    timeout: 60

Fetch tool parameters

When the agent calls the fetch tool, it passes these parameters:
ParameterTypeRequiredDescription
urlsstring[]YesOne or more URLs to fetch. Multiple URLs are fetched and returned together.
timeoutintegerNoPer-call timeout in seconds. Overrides the toolset default.
formatstringNoResponse format: markdown (default for HTML) or text.
HTML responses are automatically converted to Markdown for easier reading by the model.

Example agent

fetch_docker.yaml
agents:
  root:
    model: anthropic/claude-3-7-sonnet-latest
    description: Web content analyzer
    instruction: |
      You are a web content analyzer that fetches web pages and provides
      concise summaries. When asked to summarize a website:
      1. Use the fetch tool to retrieve the content.
      2. Analyze the content and extract key information.
      3. Provide a clear, structured summary.
    toolsets:
      - type: fetch
Fetch vs. API tool: The fetch tool gives the agent full control over HTTP requests at runtime. The API tool lets you predefine specific API calls as named tools with typed parameters. Use fetch for general-purpose HTTP access; use api for well-known endpoints you want to expose as structured tools.

Security considerations

The fetch tool makes outbound network requests to any URL the agent chooses. If your agent should only access specific URLs, use the API tool or an MCP server that restricts the allowed endpoints.

API

Expose specific HTTP endpoints as structured tools.

Script

Run curl commands as predefined shell scripts.

Shell

Execute arbitrary commands including curl and wget.

Tools overview

Compare all built-in toolsets.

Build docs developers (and LLMs) love