Skip to main content
Glama

screenshot

Capture webpage screenshots to visually analyze design issues, layout problems, and UI quality for frontend development and accessibility testing.

Instructions

Capture a screenshot of a webpage. Returns a PNG image that you can visually analyze for design issues, layout problems, and UI quality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL of the page to screenshot (e.g., http://localhost:3000)
widthNoViewport width in pixels
heightNoViewport height in pixels
fullPageNoCapture the full scrollable page
delayNoWait time in ms after page load before capturing

Implementation Reference

  • The handler function that executes the screenshot capture logic using a headless browser.
    export async function captureScreenshot(
      input: ScreenshotInput
    ): Promise<ScreenshotResult> {
      const width = input.width ?? 1440;
      const height = input.height ?? 900;
      const fullPage = input.fullPage ?? true;
      const delay = input.delay ?? 1000;
      const deviceScaleFactor = input.deviceScaleFactor ?? 2;
    
      const page = await createPage(width, height, deviceScaleFactor);
    
      try {
        await navigateAndWait(page, input.url, delay);
    
        const screenshotBuffer = await page.screenshot({
          type: "png",
          fullPage,
          encoding: "binary",
        });
    
        const base64 = Buffer.from(screenshotBuffer).toString("base64");
    
        return {
          base64,
          mimeType: "image/png",
          width,
          height,
          url: input.url,
          timestamp: new Date().toISOString(),
        };
      } finally {
        await closePage(page);
      }
    }
  • Type definition for the input parameters required by the screenshot tool.
    export interface ScreenshotInput {
      readonly url: string;
      readonly width?: number;
      readonly height?: number;
      readonly fullPage?: boolean;
      readonly delay?: number;
      readonly deviceScaleFactor?: number;
    }
  • src/server.ts:262-268 (registration)
    Registration of the "screenshot" tool in the MCP server.
    server.tool(
      "screenshot",
      "Capture a screenshot of a webpage. Returns a PNG image that you can visually analyze for design issues, layout problems, and UI quality.",
      {
        url: z.string().url().describe("URL of the page to screenshot (e.g., http://localhost:3000)"),
        width: z.number().optional().default(1440).describe("Viewport width in pixels"),
        height: z.number().optional().default(900).describe("Viewport height in pixels"),
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses the return format ('Returns a PNG image'), which is essential without an output schema. However, it omits other behavioral traits: whether the operation is read-only/safe, if screenshots are persisted to disk, rate limits, or maximum capture dimensions.

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 efficient sentences with zero waste. First sentence states the action, second states the return value and use case. Front-loaded and appropriately sized.

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?

Without output schema, the description appropriately identifies the return type (PNG image). All 5 parameters are well-documented in schema. Minor gap: lacks explicit safety declaration (read-only) that would normally appear in annotations.

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 has 100% description coverage (all 5 params documented). Description does not add parameter-specific semantics (e.g., explaining that delay helps with animations, or how fullPage interacts with height), earning the baseline score for high schema coverage.

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?

Clear verb 'Capture' and resource 'screenshot of a webpage'. Mentions specific use case (visual analysis for design/layout/UI quality). However, it does not explicitly distinguish from siblings like responsive_screenshots (multiple viewports) or compare_screenshots (diffing), though singular 'screenshot' implies single capture.

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?

Implies usage context by mentioning 'visually analyze for design issues, layout problems, and UI quality'. However, lacks explicit when-to-use guidance versus siblings (e.g., when to choose responsive_screenshots instead) or prerequisites (e.g., page must be publicly accessible).

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/prembobby39-gif/uimax-mcp'

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