Skip to main content
Glama

fetchWebContent

Read-onlyIdempotent

Retrieve and clean web pages, docs, or PDFs by removing ads while preserving code and tables. Use outline, section IDs, BM25 focus, batching, and paging for long or token-heavy content.

Instructions

Fetch readable web content/docs/PDFs. Auto-cleans ads, keeps code/tables. Supports outline mode & sectionId for long docs, BM25 focus, batch URLs (1-3), and startIndex paging.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "fetchWebContent"
  }
}

Input Schema

NameRequiredDescriptionDefault
rawNo(Deprecated: use format='raw') Return raw response body without extraction
urlNoPublic HTTP(S) URL or array of 1-3 URLs to fetch. Array fetches concurrently and splits maxChars budget
modeNoExtraction mode: 'full' (default) returns content body; 'outline' returns H1-H4 heading tree with section slug IDs and char estimates — use on long docs to avoid burning tokens
urlsNo(Optional alias for url array) Batch URLs (1~3 URLs run concurrently)
cacheNoCache mode: 'default' uses disk Markdown cache; 'reload' forces re-fetching upstream
focusNoKeyword or topic to target. Uses BM25 semantic scoring to rank and extract relevant paragraphs, saving tokens on long pages
formatNoContent format: 'markdown' (default, keeps headings, code blocks, tables), 'text' (compact plain text), or 'raw' (unprocessed HTML/source)
extractNoExtract structured JSON via CSS selectors without LLM
maxCharsNoMax characters to return (default 30000). Use with startIndex for paging
selectorNoCSS selector to narrow extraction to a specific DOM subtree
citationsNoRewrite inline links as numbered citations and append a '## References' list
focusModeNoFocus scoring algorithm (default 'bm25'; 'window' keeps ±2500 char slice around first match)
sectionIdNoDirectly extract a specific section by heading slug ID or title (from outline mode). Reads until next same-level heading
startIndexNoCharacter offset to start reading from. Use nextStartIndex from a previous response to page through long content
readabilityNoForce readability parser (default: auto-detected based on content)
retainLinksNoInline link style: 'all' (default), 'text' (strip URLs, saves tokens on index pages), 'none'
includeLinksNoInclude extracted links array in metadata

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed20 schema fields changedv1.6.1
    • changedInput schema / properties / citations / description
      Previous value: -"Rewrite inline links as numbered citations and append a '## References' list, so the answer can cite sources"New value: +"Rewrite inline links as numbered citations and append a '## References' list"
    • changedInput schema / properties / extract / description
      Previous value: -"Extract structured JSON instead of markdown, using CSS selectors — no LLM needed. fields: [{name, selector, type: text|html|markdown|attribute|list, attribute?, fields?, all?}]; selector '@attr' reads an attribute of the current node"New value: +"Extract structured JSON via CSS selectors without LLM"
    • changedInput schema / properties / focus / description
      Previous value: -"Keyword or section name to target (e.g. 'Auth', 'Config'); returns targeted window (~5000 chars) instead of burning tokens on full document"New value: +"Keyword or topic to target. Uses BM25 semantic scoring to rank and extract relevant paragraphs, saving tokens on long pages"
    • changedInput schema / properties / focusMode / description
      Previous value: -"How focus selects text: 'bm25' (default) ranks paragraphs by relevance and keeps the best ones; 'window' keeps the old ±2500-char window around the first match"New value: +"Focus scoring algorithm (default 'bm25'; 'window' keeps ±2500 char slice around first match)"
    • changedInput schema / properties / format / description
      Previous value: -"Content format (default: 'markdown' when raw is false): 'markdown' preserves headings, lists, fenced code blocks (with language) and GFM tables — better for technical docs; use 'text' for plain text"New value: +"Content format: 'markdown' (default, keeps headings, code blocks, tables), 'text' (compact plain text), or 'raw' (unprocessed HTML/source)"
    • changedInput schema / properties / format / enum
      Previous value: -[
      -  "text",
      -  "markdown"
      -]New value: +[
      +  "markdown",
      +  "text",
      +  "raw"
      +]
    • addedInput schema / properties / includeLinks / description
      Added value: +"Include extracted links array in metadata"
    • addedInput schema / properties / maxChars / description
      Added value: +"Max characters to return (default 30000). Use with startIndex for paging"
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "Extraction mode: 'full' (default) returns content body; 'outline' returns H1-H4 heading tree with section slug IDs and char estimates — use on long docs to avoid burning tokens",
      +  "enum": [
      +    "full",
      +    "outline"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / raw / description
      Previous value: -"Return the raw response body (HTML/plain text) without extraction"New value: +"(Deprecated: use format='raw') Return raw response body without extraction"
    • addedInput schema / properties / readability / description
      Added value: +"Force readability parser (default: auto-detected based on content)"
    • changedInput schema / properties / retainLinks / description
      Previous value: -"Inline link retention: 'all' (default) keeps [label](url); 'text' keeps only the label (strips URLs, big win on index/list pages); 'none' removes the link entirely. Ignored inside code blocks"New value: +"Inline link style: 'all' (default), 'text' (strip URLs, saves tokens on index pages), 'none'"
    • addedInput schema / properties / sectionId
      Added value: +{
      +  "description": "Directly extract a specific section by heading slug ID or title (from outline mode). Reads until next same-level heading",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector: return only the matched subtree, keeping code blocks and tables. Use when auto-extraction grabs the wrong container. Errors instead of silently returning the whole page when nothing matches"New value: +"CSS selector to narrow extraction to a specific DOM subtree"
    • changedInput schema / properties / startIndex / description
      Previous value: -"Character offset to start reading from (for paging through long content)"New value: +"Character offset to start reading from. Use nextStartIndex from a previous response to page through long content"
    • addedInput schema / properties / url / anyOf
      Added value: +[
      +  {
      +    "format": "uri",
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "format": "uri",
      +      "type": "string"
      +    },
      +    "maxItems": 3,
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +]
    • addedInput schema / properties / url / description
      Added value: +"Public HTTP(S) URL or array of 1-3 URLs to fetch. Array fetches concurrently and splits maxChars budget"
    • removedInput schema / properties / url / format
      Removed value: -"uri"
    • removedInput schema / properties / url / type
      Removed value: -"string"
    • changedInput schema / properties / urls / description
      Previous value: -"Batch URLs (1~3 URLs run concurrently, splitting maxChars budget; ideal for comparing search results)"New value: +"(Optional alias for url array) Batch URLs (1~3 URLs run concurrently)"
  2. Changed4 schema fields changedv1.5.1
    • changedInput schema / additionalProperties
      Previous value: -trueNew value: +{}
    • changedInput schema / properties / extract / additionalProperties
      Previous value: -trueNew value: +{}
    • changedInput schema / properties / extract / properties / fields / items / additionalProperties
      Previous value: -trueNew value: +{}
    • addedInput schema / properties / startIndex / maximum
      Added value: +9007199254740991
  3. Changed7 schema fields changedv1.3.10
    • changedInput schema / additionalProperties
      Previous value: -falseNew value: +true
    • addedInput schema / properties / cache
      Added value: +{
      +  "description": "Cache mode: 'default' uses disk Markdown cache; 'reload' forces re-fetching upstream",
      +  "enum": [
      +    "default",
      +    "reload"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / citations
      Added value: +{
      +  "description": "Rewrite inline links as numbered citations and append a '## References' list, so the answer can cite sources",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / extract
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Extract structured JSON instead of markdown, using CSS selectors — no LLM needed. fields: [{name, selector, type: text|html|markdown|attribute|list, attribute?, fields?, all?}]; selector '@attr' reads an attribute of the current node",
      +  "properties": {
      +    "baseSelector": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "fields": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "all": {
      +            "type": "boolean"
      +          },
      +          "attribute": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "fields": {
      +            "items": {},
      +            "type": "array"
      +          },
      +          "name": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "selector": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "type": {
      +            "enum": [
      +              "text",
      +              "html",
      +              "markdown",
      +              "attribute",
      +              "list"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "name"
      +        ],
      +        "type": "object"
      +      },
      +      "maxItems": 50,
      +      "minItems": 1,
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "fields"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / focusMode
      Added value: +{
      +  "description": "How focus selects text: 'bm25' (default) ranks paragraphs by relevance and keeps the best ones; 'window' keeps the old ±2500-char window around the first match",
      +  "enum": [
      +    "bm25",
      +    "window"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / retainLinks
      Added value: +{
      +  "description": "Inline link retention: 'all' (default) keeps [label](url); 'text' keeps only the label (strips URLs, big win on index/list pages); 'none' removes the link entirely. Ignored inside code blocks",
      +  "enum": [
      +    "all",
      +    "none",
      +    "text"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / selector
      Added value: +{
      +  "description": "CSS selector: return only the matched subtree, keeping code blocks and tables. Use when auto-extraction grabs the wrong container. Errors instead of silently returning the whole page when nothing matches",
      +  "minLength": 1,
      +  "type": "string"
      +}
  4. Changed3 schema fields changedv1.2.1
    • addedInput schema / properties / focus
      Added value: +{
      +  "description": "Keyword or section name to target (e.g. 'Auth', 'Config'); returns targeted window (~5000 chars) instead of burning tokens on full document",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / urls
      Added value: +{
      +  "description": "Batch URLs (1~3 URLs run concurrently, splitting maxChars budget; ideal for comparing search results)",
      +  "items": {
      +    "format": "uri",
      +    "type": "string"
      +  },
      +  "maxItems": 3,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "url"
      -]
  5. Changed1 schema field changedv1.0.25
    • changedInput schema / properties / format / description
      Previous value: -"Content format: 'markdown' preserves fenced code blocks (with language) and GFM tables — better for technical docs"New value: +"Content format (default: 'markdown' when raw is false): 'markdown' preserves headings, lists, fenced code blocks (with language) and GFM tables — better for technical docs; use 'text' for plain text"
  6. Changed1 schema field changedv1.0.15
    • addedInput schema / properties / format
      Added value: +{
      +  "description": "Content format: 'markdown' preserves fenced code blocks (with language) and GFM tables — better for technical docs",
      +  "enum": [
      +    "text",
      +    "markdown"
      +  ],
      +  "type": "string"
      +}
  7. First observedv1.0.11

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld/idempotent/non-destructive, so the safety bar is covered. The description adds genuine behavioral context beyond that: server-side ad stripping, preservation of code blocks and tables, concurrent array fetching with a split maxChars budget, and BM25-based extraction to conserve tokens. It stops short of describing failure behavior on unreachable or blocked URLs.

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?

Two sentences, front-loaded with the core purpose before the capability list. The second sentence is dense and comma-chained, but every clause corresponds to a distinct capability, so nothing is wasted.

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

Completeness3/5

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

For a 17-parameter tool with a nested extract object and no output schema, the description orients the agent on the main modes but says nothing about the shape of the response (beyond implying nextStartIndex), how extract/selector/focus interact, or what happens on extraction failure. Adequate to start, insufficient to call confidently without reading the schema.

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

Parameters3/5

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

Schema description coverage is 100%, so every one of the 17 parameters already carries its own explanation. The description merely name-drops the headline features (outline/sectionId, BM25 focus, batch URLs, startIndex) without adding syntax, format, or interplay detail beyond what the schema already states. Baseline 3 is appropriate.

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

Purpose4/5

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

The description opens with a specific verb and resource ('Fetch readable web content/docs/PDFs') and immediately differentiates the output by quality ('Auto-cleans ads, keeps code/tables'). It is clear what the tool does and what it returns, though it never names a sibling tool to contrast against, relying on the reader to infer that fetchGithubContent/queryDocs cover other sources.

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?

There is embedded usage advice — outline mode 'on long docs to avoid burning tokens', startIndex for paging, format='raw' as the replacement for the deprecated raw flag. But this is a feature catalog rather than routing guidance: it never states when to choose this tool over queryDocs or fetchGithubContent, nor any prerequisites or exclusions.

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