Skip to main content
Glama

fetch_sitemap

Read-onlyIdempotent

Fetch and parse sitemap.xml or sitemap indexes to return contained URLs with lastmod, changefreq, and priority, including gzipped files and partial-failure warnings.

Instructions

Fetch a sitemap.xml (or sitemap-index) and return the contained URLs with their lastmod / changefreq / priority. Follows sitemap-index chaining up to max_depth levels. Gzipped .xml.gz payloads are auto-decompressed. A single sitemap document over 16 MiB once decoded is refused (a 50,000-URL sitemap is ~11 MiB). Partial failures (one child sitemap 500s while others work) are returned under 'warnings' without aborting the whole request. SSRF-protected by default.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "fetch_sitemap"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesSitemap URL (sitemap.xml, sitemap.xml.gz, or a sitemap index)
max_urlsNoCap on total URLs returned (default 5000)
max_bytesNoMax bytes to read per sitemap response (default 20MiB)
max_depthNoHow many sitemap-index levels to follow (default 1). 0 keeps the top-level index flat and only returns its childSitemaps list.
timeout_msNo
user_agentNo
max_sitemapsNoCap on sitemap documents fetched -- the index plus every child (default 50, max 1000). Children past the cap are listed under childSitemaps, unfetched.
max_redirectsNo
allow_private_hostsNoAllow loopback / private / link-local targets for this call (default false). Refused unless the server operator launched fetch-mcp with FETCH_MCP_ALLOW_PRIVATE_HOSTS=1 -- SSRF protection stays on by default either way.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.0
    • addedInput schema / properties / allow_private_hosts / description
      Added value: +"Allow loopback / private / link-local targets for this call (default false). Refused unless the server operator launched fetch-mcp with FETCH_MCP_ALLOW_PRIVATE_HOSTS=1 -- SSRF protection stays on by default either way."
    • addedInput schema / properties / max_sitemaps
      Added value: +{
      +  "description": "Cap on sitemap documents fetched -- the index plus every child (default 50, max 1000). Children past the cap are listed under childSitemaps, unfetched.",
      +  "maximum": 1000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. First observedv0.6.1

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses automatic gzip decompression, index chaining depth, a decoded-size refusal at 16 MiB, partial-failure behavior returned under 'warnings' instead of aborting, and SSRF protection on by default. These are exactly the operational traits an agent needs to predict outcomes.

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?

Four compact sentences, front-loaded with what is returned, then chaining, decompression, limits, and failure behavior in descending order of importance. No sentence is filler; even the parenthetical size comparison aids calibration.

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

Completeness4/5

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

For a 9-parameter network tool with no output schema, the description covers return shape, limits, chaining, and partial failures well. It omits any mention of timeout, redirect, or user-agent behavior, but those are secondary to correct invocation.

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

Parameters4/5

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

Schema coverage is 67%, and the description adds real meaning on top: max_depth's chaining semantics, the interaction of the size cap with decoded payloads, and the SSRF/allow_private_hosts relationship. It leaves timeout_ms, user_agent, and max_redirects untouched, which keeps it short of a 5.

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?

States a specific verb and resource ('Fetch a sitemap.xml (or sitemap-index)') plus the exact return payload (URLs with lastmod/changefreq/priority). This clearly separates it from siblings like fetch_robots, fetch_links, and fetch_feed without the agent needing to open any schema.

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

Usage Guidelines3/5

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

The description implies its use case (pulling sitemap URLs) but never states when to pick it over fetch_links or fetch_reader, nor any prerequisites such as needing a sitemap URL rather than a site root. Usage is inferable but not routed.

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