Skip to main content
Glama

page_info

Extract page metadata like title, viewport size, fonts, and resource counts to audit web pages without taking screenshots.

Instructions

Get page metadata: title, viewport size, scroll height, fonts, colors, and resource counts. Useful for auditing a page without a full screenshot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to inspect

Implementation Reference

  • The getPageInfo function performs the logic to scrape and return page metadata.
    async function getPageInfo(url) {
      const browser = await getBrowser();
      const page = await browser.newPage();
    
      try {
        await page.setViewport({ width: 1440, height: 900 });
        await page.goto(url, { waitUntil: "networkidle2", timeout: 30000 });
    
        const info = await page.evaluate(() => ({
          title: document.title,
          url: window.location.href,
          viewport: {
            width: window.innerWidth,
            height: window.innerHeight,
            scrollHeight: document.documentElement.scrollHeight,
          },
          meta: {
            description: document.querySelector('meta[name="description"]')?.content || null,
            theme: document.querySelector('meta[name="theme-color"]')?.content || null,
          },
          fonts: [...new Set([...document.querySelectorAll("*")].map(
            (el) => getComputedStyle(el).fontFamily
          ).filter(Boolean))].slice(0, 10),
          colors: (() => {
            const bg = getComputedStyle(document.body).backgroundColor;
            const fg = getComputedStyle(document.body).color;
            return { background: bg, foreground: fg };
          })(),
          links: document.querySelectorAll("a").length,
          images: document.querySelectorAll("img").length,
          scripts: document.querySelectorAll("script").length,
          stylesheets: document.querySelectorAll('link[rel="stylesheet"]').length,
        }));
    
        return info;
      } finally {
        await page.close();
      }
    }
  • src/index.js:268-283 (registration)
    The 'page_info' tool is defined within the ListToolsRequestSchema handler.
    {
      name: "page_info",
      description:
        "Get page metadata: title, viewport size, scroll height, fonts, colors, " +
        "and resource counts. Useful for auditing a page without a full screenshot.",
      inputSchema: {
        type: "object",
        properties: {
          url: {
            type: "string",
            description: "URL to inspect",
          },
        },
        required: ["url"],
      },
    },
  • The case block in the CallToolRequestSchema handler that invokes getPageInfo.
    case "page_info": {
      const info = await getPageInfo(args.url);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(info, null, 2),
          },
        ],
      };
    }
Behavior3/5

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

No annotations provided, so description carries full burden. Compensates by listing specific metadata fields returned (title, viewport, scroll height, etc.) since no output schema exists. However, omits behavioral details like page loading strategy, JavaScript execution, or caching 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?

Two sentences with zero waste: first front-loaded with capability list, second provides usage context. Every word earns its place; appropriately sized for tool complexity.

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?

Given single parameter and lack of output schema, description adequately compensates by enumerating return metadata fields. Addresses sibling tool relationship. Minor gap: no mention of error handling or authentication requirements.

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 coverage is 100% ('URL to inspect'), establishing baseline 3. Description implies the URL should be a web page (given 'page metadata' context) but adds minimal syntax or format guidance beyond the schema description.

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?

Clear specific verb ('Get') and resource ('page metadata') with explicit enumerated return values (title, viewport, fonts, etc.). Explicitly distinguishes from sibling 'screenshot' tool by contrasting with 'without a full screenshot'.

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?

States use case ('auditing a page') and implicitly positions against screenshot alternative ('without a full screenshot'). Lacks explicit 'when not to use' guidance, but context is clear enough 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/kjaiswal/browsershot-mcp'

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