Skip to main content
Glama

fetch

Read-only

Fetch any URL and convert it to clean Markdown for AI processing. Supports HTML, PDF, JSON, and SPA data extraction with advanced features.

Instructions

Fetch a URL and convert to clean markdown for LLM consumption.

Content conversion (automatic by Content-Type):

  • HTML → clean markdown (boilerplate removed, links preserved)

  • PDF → markdown with headings and table detection (requires pdf feature)

  • JSON/plain text → passthrough

  • SPA data auto-extracted (NEXT_DATA, NUXT, APOLLO_STATE, etc.)

Network features:

  • HTTP/2 multiplexing, HTTP/3 (QUIC) with 0-RTT

  • TLS 1.3, Brotli/Zstd/Gzip decompression

  • Realistic browser fingerprints (Chrome/Firefox/Safari)

  • Browser cookie injection (Brave/Chrome/Firefox/Safari)

Diff mode (diff: true):

  • Compares current content against the previous snapshot for this URL

  • Returns only the changed sections (token-efficient for monitoring tasks)

  • First fetch caches the page; subsequent fetches return semantic diffs

  • Unchanged content returns a 5-token confirmation instead of full body

Focus mode (focus: query):

  • Keeps only sections relevant to the query (BM25 scoring)

  • Replaces dropped sections with '[N sections omitted]' markers

  • Diff markers are always preserved regardless of relevance

Token budget (max_tokens: N):

  • Structure-aware truncation preserving headings, code, and tables

  • Priority: title > code/tables > headings (30% cap) > body > blockquotes

Returns: Markdown-converted body with timing info (or diff when diff: true).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
cookiesNo
diffYesWhen true, return only changed content vs the previous snapshot. On first fetch the page is cached and full content is returned. On subsequent fetches only the semantic diff is returned, saving tokens for monitoring or change-detection workflows.
focusNoNatural-language query to focus extraction on relevant sections. When set, uses BM25 scoring to keep only the sections most relevant to the query, replacing omitted sections with count markers. Dramatically reduces token count for large documents when you know what you're looking for.
headersYes
max_tokensNoMaximum token budget for the returned content. When set, performs structure-aware truncation that preserves headings, code blocks, and tables before trimming body text. Uses priority scoring: title/summary first, then code/tables, then headings (capped at 30% of budget), then body text.
sessionNoNamed session for cookie persistence across calls. When set, nab uses an isolated per-session cookie jar so that `Set-Cookie` response headers from one call are automatically included on the next call with the same session name. Use this to maintain authenticated state across multiple `fetch` calls after a `login`. Session names: 1-64 chars, alphanumeric + hyphens + underscores. Sessions are created implicitly on first use and live for the process lifetime. Absent = stateless global client (no change).
urlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesMarkdown-converted body content
content_typeNoResponse Content-Type header
has_diffYesTrue when diff mode was requested and content changed since last snapshot
statusYesHTTP status code
timing_msYesRound-trip time in milliseconds
urlYesThe fetched URL
Behavior5/5

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

Annotations (readOnlyHint: true) are consistent with read operation. Description adds extensive behavioral context: automatic content conversion per Content-Type, network features, diff mode caching, token budget truncation. No contradictions.

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?

Well-structured with sections for content conversion, network features, modes. Every sentence adds value; no redundancy. Appropriate length given tool complexity.

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?

Covers all major aspects: input, modes, return values (with output schema hinted). Handles complexity of 8 params and varied behaviors. Complete for an information retrieval tool.

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 coverage is 50%, but description compensates by explaining all parameters in detail: diff caching, focus BM25 scoring, max_tokens priority, session persistence, and implied url/headers/body behavior. Adds meaning beyond schema.

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?

Description states 'Fetch a URL and convert to clean markdown for LLM consumption.' It clearly identifies the verb (fetch) and resource (URL), and distinguishes from siblings like fetch_batch and submit.

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

Usage Guidelines4/5

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

Provides implicit guidance via sibling tools (fetch_batch for multiple URLs, login for auth). Describes when to use diff and focus modes. Lacks explicit 'when not to use' but sufficient for most agents.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MikkoParkkola/nab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server