Skip to main content
Glama

screenshot

Capture screenshots of web pages for documentation, testing, or sharing purposes using browser automation on ARM64 devices.

Instructions

Take a screenshot of the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoName for the screenshot filescreenshot.png
fullPageNoCapture full page

Implementation Reference

  • Main handler function that executes the screenshot tool logic: ensures Chromium is running, optionally sets full-page metrics, captures screenshot via Page.captureScreenshot CDP command, saves as PNG to /tmp/, and returns success message.
    async screenshot(name = 'screenshot.png', fullPage = false) {
      await this.ensureChromium();
      
      const screenshotParams = { format: 'png' };
      
      if (fullPage) {
        const metrics = await this.sendCDPCommand('Page.getLayoutMetrics');
        await this.sendCDPCommand('Emulation.setDeviceMetricsOverride', {
          width: metrics.contentSize.width,
          height: metrics.contentSize.height,
          deviceScaleFactor: 1,
          mobile: false,
        });
        screenshotParams.clip = {
          x: 0,
          y: 0,
          width: metrics.contentSize.width,
          height: metrics.contentSize.height,
          scale: 1,
        };
      }
    
      const screenshot = await this.sendCDPCommand('Page.captureScreenshot', screenshotParams);
      const screenshotPath = `/tmp/${name}`;
      
      fs.writeFileSync(screenshotPath, screenshot.data, 'base64');
      
      return {
        content: [{ type: 'text', text: `Screenshot saved to ${screenshotPath}` }],
      };
    }
  • Registration of the 'screenshot' tool in the ListToolsRequestSchema handler, defining name, description, and input schema for parameters 'name' and 'fullPage'.
    {
      name: 'screenshot',
      description: 'Take a screenshot of the current page',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name for the screenshot file',
            default: 'screenshot.png',
          },
          fullPage: {
            type: 'boolean',
            description: 'Capture full page',
            default: false,
          },
        },
      },
    },
  • Dispatch handler in CallToolRequestSchema switch statement that invokes the screenshot method with parsed arguments.
    case 'screenshot':
      return await this.screenshot(args.name, args.fullPage);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action but doesn't disclose behavioral traits such as whether it saves the screenshot locally, returns it as data, requires specific permissions, or has side effects. For a tool with no annotation coverage, this is a significant gap in transparency.

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?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple tool, making it easy to parse quickly.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., file path, binary data) or behavioral details like error handling. For a tool with 2 parameters and no structured coverage beyond the input schema, more context is needed to be fully helpful.

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 the schema already documents both parameters ('name' and 'fullPage') with descriptions and defaults. The description adds no additional meaning beyond what the schema provides, such as explaining the implications of 'fullPage' or file naming conventions. Baseline 3 is appropriate when schema does the heavy lifting.

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 'Take a screenshot of the current page' clearly states the action (take) and resource (screenshot of current page) with specific scope. It distinguishes from siblings like 'get_content' (which retrieves page content) or 'run_audit_mode' (which performs analysis) by focusing on visual capture.

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. It doesn't mention prerequisites (e.g., requires a page to be loaded), exclusions, or comparisons with similar tools like 'get_content' for textual data. The description only states what it does, not when to choose it.

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/nfodor/claude-arm64-browser'

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