Skip to main content
Glama

Fetch web page

web_fetch
Read-onlyIdempotent

Fetches a public web page with a plain GET and returns its HTML as is (cut at maxChars), or - when selectors are given - only the values plucked from it with CSS selectors. Use selectors for large pages: e.g. {"post": "article"} for text, or {"text": {"selector": "meta[property="og:description"]", "attr": "content"}} for a meta tag. A non-2xx response is returned with its status and body so you can see why a site refused. For a tweet or X post, oembed is smaller and more reliable. This does not read video or audio - use media_transcribe for those.

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>",
      "context": "<context>"
    },
    "name": "web_fetch"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesHTTP or HTTPS URL of a public page. Addresses on private networks (localhost, 10.x, 192.168.x, cloud metadata) cannot be fetched.
cleanNoDrop script, style, noscript and svg elements from the returned HTML
contextYesExplain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization."
maxCharsNoLongest HTML body to return (default 100000, max 500000). Ignored when selectors are given.
selectorsNoResult name to CSS selector. A plain string returns the text of all matches; use {selector, attr | html, all} for an attribute (e.g. a meta tag's content), outer HTML, or every match. When given, the page itself is not returned - prefer this on large pages.
workspace_idNoWhich workspace to act in - a workspace id (whoami returns the id of your default workspace). Omit to use your default workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior3/5

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

The annotations already establish read-only, idempotent, open-world behavior, so the description's added value is in disclosing error semantics ("A non-2xx response is returned with its status and body so you can see why a site refused"), truncation at maxChars, and that selectors suppress the page body. That is useful operational context, but it does not cover other meaningful traits such as JavaScript rendering limits, timeouts, or rate limiting.

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?

Five tight sentences, front-loaded with the core operation, then the selector mode, then failure behavior, then alternative tools. Every sentence carries distinct information with no restatement of the name or title.

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 six-parameter, nested-selector tool with no output schema, the description covers the return format for both modes and for error responses, which is what an agent most needs. Minor gaps remain around JS-heavy pages and pagination/size behavior on the selector path, but nothing essential to selecting or invoking it is missing.

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 description coverage is 100%, so the baseline is 3, but the description goes beyond restating the schema by giving concrete selector payload examples ({"post": "article"} and the attr-based meta tag form) that show how the plain-string and object forms actually get used. The maxChars interaction with selectors is reinforced, though the required context parameter and workspace_id are left to the 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?

The description states a specific verb and resource ("Fetches a public web page with a plain GET") and precisely defines the two return modes: raw HTML cut at maxChars, or values extracted via CSS selectors. It also explicitly carves out territory from siblings by naming oembed for tweets/X posts and media_transcribe for video/audio.

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

Usage Guidelines5/5

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

It gives explicit routing advice: "Use selectors for large pages," "For a tweet or X post, oembed is smaller and more reliable," and "This does not read video or audio - use media_transcribe for those." Both the when-to-use and the when-to-use-something-else cases are covered with named alternatives.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources