Skip to main content
Glama

extract_web_content

Extract token-optimized, clean Markdown content from a target website for LLM consumption.

Instructions

Extract token-optimized, clean Markdown content from a target website for LLM consumption.

What it does Fetches a URL, strips HTML bloat (scripts, styles, inline SVGs, tracking tags, navigation, footers, redundant forms) and returns readable Markdown — cutting token usage by ~73% to 90% versus the raw page.

How to use

  • Use for any web page, article, or docs you want as LLM-ready text.

  • mode="fast" (default): native HTTP GET. mode="deep": headless Chrome with stealth fingerprint for JS-heavy or Cloudflare/Turnstile-protected pages.

  • css_selector scopes to a single element (e.g. "main", "article", "#content").

  • Pass headers/cookies for gated or geo-restricted content. Providing any of headers/cookies/proxy bypasses the SQLite cache.

  • No auth required. Respects robots/rate-limit via retry backoff.

Returns Markdown text. Cache hits are prefixed with a NOTE marker. Unsupported URLs (non-http, private IP, SSRF) fail with isError: true and a reason.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget website URL to extract content from.
modeNoCrawl mode: 'fast' (native HTTP fetch) or 'deep' (headless Playwright browser with JS execution).fast
proxyNoOptional HTTP/SOCKS5 proxy URL (e.g. 'http://proxy.example.com:8080').
actionsNoOptional pre-crawl automation actions for mode='deep' (e.g. click cookie consent, load more, scrolling).
cookiesNoOptional custom HTTP cookies key-value dictionary.
headersNoOptional custom HTTP request headers key-value dictionary.
image_modeNoImage handling: 'ignore' (omit images), 'alt_only' (> 🖼️ *[Imagem: alt]*), or 'markdown' (![alt](src)). Default: ignore.ignore
link_formatNoLink formatting: 'inline' ([text](url)), 'references' ([text][1] footnote citations at end), or 'strip' (plain text). Default: inline.inline
max_retriesNoMaximum retry attempts for transient errors or rate limits (default: 3).
css_selectorNoOptional CSS selector to scope content extraction to a specific HTML node (e.g. 'main', 'article').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv1.1.2
    • changedInput schema / properties / actions / items / properties / milliseconds / description
      Previous value: -"Milliseconds to wait"New value: +"Milliseconds to wait (max 10000)"
    • addedInput schema / properties / actions / items / properties / milliseconds / maximum
      Added value: +10000
    • addedInput schema / properties / actions / items / properties / milliseconds / minimum
      Added value: +0
    • changedInput schema / properties / actions / items / properties / milliseconds / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / actions / items / properties / pixels / description
      Previous value: -"Pixels to scroll"New value: +"Pixels to scroll (max 20000)"
    • addedInput schema / properties / actions / items / properties / pixels / maximum
      Added value: +20000
    • addedInput schema / properties / actions / items / properties / pixels / minimum
      Added value: +0
    • changedInput schema / properties / actions / items / properties / pixels / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / actions / items / properties / selector / maxLength
      Added value: +500
    • addedInput schema / properties / actions / items / properties / value / maxLength
      Added value: +5000
    • addedInput schema / properties / actions / maxItems
      Added value: +20
  2. Changed4 schema fields changedv1.1.1
    • addedInput schema / properties / actions
      Added value: +{
      +  "description": "Optional pre-crawl automation actions for mode='deep' (e.g. click cookie consent, load more, scrolling).",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "direction": {
      +        "description": "Scroll direction",
      +        "enum": [
      +          "up",
      +          "down"
      +        ],
      +        "type": "string"
      +      },
      +      "milliseconds": {
      +        "description": "Milliseconds to wait",
      +        "type": "number"
      +      },
      +      "pixels": {
      +        "description": "Pixels to scroll",
      +        "type": "number"
      +      },
      +      "selector": {
      +        "description": "CSS selector for click/fill",
      +        "type": "string"
      +      },
      +      "type": {
      +        "description": "Action type",
      +        "enum": [
      +          "click",
      +          "scroll",
      +          "wait",
      +          "fill"
      +        ],
      +        "type": "string"
      +      },
      +      "value": {
      +        "description": "Text value to fill into input",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / css_selector / description
      Previous value: -"Optional CSS selector to scope content extraction to a specific HTML node."New value: +"Optional CSS selector to scope content extraction to a specific HTML node (e.g. 'main', 'article')."
    • addedInput schema / properties / image_mode
      Added value: +{
      +  "default": "ignore",
      +  "description": "Image handling: 'ignore' (omit images), 'alt_only' (> 🖼️ *[Imagem: alt]*), or 'markdown' (![alt](src)). Default: ignore.",
      +  "enum": [
      +    "ignore",
      +    "alt_only",
      +    "markdown"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / link_format
      Added value: +{
      +  "default": "inline",
      +  "description": "Link formatting: 'inline' ([text](url)), 'references' ([text][1] footnote citations at end), or 'strip' (plain text). Default: inline.",
      +  "enum": [
      +    "inline",
      +    "references",
      +    "strip"
      +  ],
      +  "type": "string"
      +}
  3. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden, and it delivers: caching behavior (header/cookie/proxy bypasses SQLite cache), auth-free access, robots/rate-limit respect via retry backoff, and failure semantics (isError: true for unsupported/SSRF URLs). It omits any note on rate limits' magnitude, output size caps, or timeout behavior.

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?

Front-loaded one-line purpose, then clearly labeled What it does / How to use / Returns sections. Every sentence adds actionable information with zero filler, and it is well sized for a 10-param tool.

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 10-parameter tool with nested actions, 100% schema coverage, and no output schema, the description covers purpose, mode selection, caching, auth, and error behavior adequately. A brief mention of actions usage or pagination/output limits would make it fully complete.

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 100%, setting a baseline of 3, but the description adds meaning beyond the schema: it explains mode tradeoffs (native HTTP vs stealth headless Chrome), that css_selector scopes to a single element, and that supplying headers/cookies/proxy changes caching. The nested actions array is only lightly touched via mode='deep' context.

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 (Extract) and resource (web content), and qualifies the output precisely as token-optimized clean Markdown for LLM consumption. This distinguishes it from siblings like crawl_website and extract_structured_data by naming the output format rather than a crawl or structured-data framing.

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?

Gives concrete when-to-use (any page, article, or docs) and per-parameter routing advice like mode=fast vs mode=deep for JS-heavy or Cloudflare-protected pages. It does not explicitly name sibling alternatives such as crawl_website or extract_structured_data to say when not to use this tool.

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