Skip to main content
Glama

web_read

Fetch and read web page content from a URL. Returns parsed text from HTML documents to supply information to language models.

Instructions

Alias of web.read

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
htmlNo

Implementation Reference

  • The main handler function for web_read. Uses JSDOM and Readability to parse HTML and extract readable content (title, byline, text, word count, links, meta).
    export function webRead(args: { url: string, html?: string }) {
      const { url, html } = args;
      const doc = new JSDOM(html || '', { url });
      const reader = new Readability(doc.window.document);
      const art = reader.parse();
      if (!art) return { title: '', byline: '', lang: '', text: '', wordCount: 0, links: [], meta: {} };
      const links: Array<{text: string, url: string}> = [];
      const anchorEls = doc.window.document.querySelectorAll('a[href]');
      anchorEls.forEach(a => {
        const href = (a as HTMLAnchorElement).href;
        const text = (a as HTMLElement).textContent?.trim() || '';
        if (href) links.push({ text, url: href });
      });
      const meta: Record<string,string> = {};
      const metas = doc.window.document.querySelectorAll('meta[name], meta[property]');
      metas.forEach((m:any) => {
        const key = m.getAttribute('name') || m.getAttribute('property');
        const val = m.getAttribute('content');
        if (key && val) meta[key] = val;
      });
      return {
        title: art.title || '', byline: art.byline || '',
        lang: (doc.window.document.documentElement.getAttribute('lang') || '').toLowerCase(),
        text: art.textContent || '', wordCount: (art.textContent || '').split(/\s+/).filter(Boolean).length,
        links, meta
      };
    }
  • Input schema for web.read/web_read tool: url (string, required) and html (string, optional).
    const webReadShape = { url: z.string(), html: z.string().optional() };
  • src/server.ts:88-101 (registration)
    Registration of the 'web.read' tool and its alias 'web_read' with the MCP server, both calling the webRead handler.
    server.tool('web.read', 'Extract readable content from given HTML (or pass html from web.fetch).',
      webReadShape, OPEN,
      async ({ url, html }) => {
        const res = webRead({ url, html });
        return { content: [{ type: 'text', text: JSON.stringify(res) }] };
      }
    );
    server.tool('web_read', 'Alias of web.read',
      webReadShape, OPEN,
      async ({ url, html }) => {
        const res = webRead({ url, html });
        return { content: [{ type: 'text', text: JSON.stringify(res) }] };
      }
    );
Behavior2/5

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

The description provides no behavioral details beyond being an alias. The annotation 'openWorldHint' is not explained, and the tool's read-only or mutation nature is not disclosed.

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

Conciseness2/5

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

While the description is short, it is under-specified and fails to earn its place. A tool alias without purpose definition is not concise but rather incomplete.

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

Completeness1/5

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

Given no output schema, no parameter descriptions, and a minimal description that only points to another tool, the context is severely lacking for effective tool use.

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

Parameters1/5

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

The input schema has 0% description coverage, and the tool description adds no meaning to the 'url' or 'html' parameters. The agent receives no guidance on valid inputs.

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

Purpose2/5

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

The description 'Alias of web.read' fails to specify what the tool actually does. It references another tool but does not explain the functionality, leaving the purpose vague and unclear.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like web.read, web.fetch, or others. The description offers no context for selection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/khanhs-234/tool4lm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server