Skip to main content
Glama

Fetch a URL: page text, document, or resource

fetch
Read-onlyIdempotent

Retrieve one URL and get readable page text, parsed document content, or a description for non-text resources. Verifies claims by reading the source directly.

Instructions

Fetch one URL: page text, or a description of a non-text resource.

Handles any http(s) resource, not just HTML:
- HTML pages -> reader-mode Markdown (nav/footer/scripts stripped).
- PDF/DOCX/XLSX/PPTX/EPUB/CSV/code/archives -> parsed text (same engine as
  `read_doc`, which you should prefer when you need pagination).
- Images, video, audio, fonts, opaque binaries -> a description
  (media type, byte size, dimensions, sha256), NOT the bytes.

Best for:
- You already have a URL (from `search`, the user, or your own knowledge)
  and need the actual page text.
- Verifying a single claim by reading the source.
- Checking what a resource IS before deciding to spend tokens on it.

Not recommended for:
- Multiple URLs at once -> use `fetch_batch` (concurrent, one round-trip).
- "Search then read top N" -> use `research` (one call, not two).
- Long documents you need to page through -> use `read_doc` (start/length).
- You don't have a URL yet -> use `search` first.

Returns:
- markdown (default): a small header (URL, render method, token count)
  plus the cleaned page body.
- json: {url, title, content, method, truncated, tokens_estimated,
  author, published_date, sitename}, plus {media_type, bytes_size, sha256,
  width, height} for non-text resources.
- With `inline=True` on an image: the image itself, viewable by a
  vision-capable model.

Common mistakes:
- Passing a search query instead of a URL.
- Using `render="http"` on a JS-only SPA: it returns near-empty content;
  use "auto" (default) or "browser".
- Setting `inline=True` on a large image out of habit. A 1MB image costs
  well over a thousand tokens; fetch it plainly first and inline only if
  the description says it's worth looking at.
- Forgetting that results are cached 7 days: use `force_refresh=True`
  or `max_age_hours=0` for a fresh pull. The header says `cached N days ago`
  when you are not looking at the live page; for deadlines, prices and
  anything else that moves, that is the cue to refresh.
- Reading `no publication date found` as "recent". It means unknown.

Args:
    url: Absolute http(s) URL.
    render: "auto" (try HTTP, fall back to stealth Chromium), "http"
        (fast, fails on JS), "browser" (slow, robust).
    force_refresh: Bypass the page cache entirely.
    max_age_hours: Treat cached pages older than this as a miss. 0 = same
        as force_refresh. None = server default TTL (7 days).
    inline: For images only. Returns the image itself instead of a
        description, so a vision-capable model can see it. Ignored for
        text resources.
    format: "markdown" or "json".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
formatNomarkdown
inlineNo
renderNoauto
force_refreshNo
max_age_hoursNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.1
    • addedInput schema / properties / inline
      Added value: +{
      +  "default": false,
      +  "title": "Inline",
      +  "type": "boolean"
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "additionalProperties": true,
      -          "type": "object"
      -        }
      -      ],
      -      "title": "Result"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "fetchOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint, openWorldHint, and idempotentHint, and the description adds extensive context beyond them: cache behavior with 7-day TTL and force_refresh semantics, render mode differences including caveats for JS-only SPAs, inline image token costs, and the meaning of 'no publication date found'. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is lengthy but densely structured with clear headers, bullet lists, and code-style naming. Every section adds actionable information: return formats, common mistakes, and parameter semantics. No redundant fluff; the structure makes the length digestible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with six parameters and no output schema, the description is remarkably complete. It covers input requirements, output shapes for markdown and json, non-text resource descriptions, caching, render strategies, and failure-prone usage patterns. An agent has everything needed to invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden, and it delivers a detailed Args section explaining every parameter, including defaults (render='auto', format='markdown') and nuanced behavior (max_age_hours=0 means force_refresh, None means server TTL). This fully compensates for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Fetch one URL: page text, or a description of a non-text resource.' It clearly identifies what the tool does and differentiates it from siblings by listing what it is not (batch fetch, research, read_doc). An agent can select it correctly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'Best for' and 'Not recommended for' sections, naming alternatives like fetch_batch, research, read_doc, and search with precise conditions. This is exactly the level of guidance needed to route the agent to the right tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.