Skip to main content
Glama

fetch

Retrieve any URL and convert it to clean, LLM-ready markdown with metadata, link extraction, and prompt injection scanning—so you can safely feed web content to language models.

Instructions

Fetch a URL and return clean, LLM-ready markdown with metadata and prompt injection scanning.

Args: url: The URL to fetch. timeout: Request timeout in seconds. max_words: Optional word cap on extracted body content. strict: When True and high-risk injection is detected, the response is marked as an error. js: Use Playwright for JavaScript-rendered pages (requires playwright + chromium). links: Link extraction mode — "domains" (default) or "full" for all URLs with anchor text. auth_token: Bearer token for Authorization header (e.g. "my-api-key"). headers: Deprecated. Use auth_token instead. Custom HTTP headers to include in the request.

Returns: A structured dict with url, body (markdown), metadata, links, risk_level, injection_matches, sanitization stats, and edge case info.

Input Schema

NameRequiredDescriptionDefault
jsNo
urlYes
linksNodomains
strictNo
headersNo
timeoutNo
max_wordsNo
auth_tokenNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "fetchDictOutput",
      +  "type": "object"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / auth_token
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Auth Token"
      +}
    • addedInput schema / properties / headers
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Headers"
      +}
    • addedInput schema / properties / links / enum
      Added value: +[
      +  "domains",
      +  "full"
      +]
  3. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses injection scanning, a risk_level field, strict-mode error semantics, the Playwright/Chromium dependency for JS rendering, and the deprecation of headers. It stops short of stating auth requirements, rate limits, or timeouts' default/behavioral consequences.

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

Conciseness4/5

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

Front-loaded one-sentence summary followed by a scannable Args block is good structure. The Returns section is somewhat redundant since an output schema exists, and the docstring formatting is verbose, but nothing is wasted.

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 an 8-parameter, network-facing tool with no annotations, the description covers parameters and key behavior well. The Returns block duplicates an existing output schema, and it never states whether fetching is read-only or what happens on redirects/failures, leaving a small completeness gap.

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 must fully compensate, and it does — all eight parameters are documented with meaning beyond their titles (links enum modes, strict semantics, auth_token format example, deprecation note). This is the tool's strongest dimension.

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 opening sentence states a specific verb (fetch), a specific resource (URL), and distinguishes the output precisely: clean LLM-ready markdown with metadata plus prompt-injection scanning. That last clause separates it from a plain HTTP fetch tool. No siblings exist, so no differentiation is needed.

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?

It gives conditional guidance for optional behavior: js requires playwright + chromium, strict only errors on high-risk injection, links has two modes, and headers is deprecated in favor of auth_token. There is no explicit when-to-use framing, but with no sibling tools there is nothing to route against, so the gaps are minor.

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

Deploy Server

Other Tools