Skip to main content
Glama

screenshot

Capture the current webpage as an image for documentation, debugging, or visual reference purposes.

Instructions

Take a screenshot of the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoOptional filename for the screenshot

Implementation Reference

  • MCP tool handler for 'screenshot' tool. Receives filename parameter, calls browser.screenshot(), and returns success message with file path.
    handler: async ({ filename }) => {
      const path = await browser.screenshot(filename);
      return { success: true, message: `Screenshot saved to ${path}` };
    }
  • Input schema for screenshot tool. Accepts optional 'filename' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        filename: { type: 'string', description: 'Optional filename for the screenshot' }
      },
      required: []
    },
  • Core screenshot implementation in SimpleBrowser class. Ensures browser is launched, generates filename if not provided, takes screenshot with Playwright, returns path.
    async screenshot(filename) {
      await this.ensureLaunched();
      const path = filename || `screenshot-${Date.now()}.png`;
      await this.page.screenshot({ path });
      return path;
    }
  • tools.js:18-21 (registration)
    Includes all Playwright tools (including screenshot) from createPlaywrightTools into the main createTools() array via spread operator.
    const playwrightTools = createPlaywrightTools(browser);
    
    return [
      ...playwrightTools,
  • index.js:75-77 (registration)
    Creates complete tools list via createTools(browser) and registers generic MCP handlers (CallToolRequestSchema and ListToolsRequestSchema) that dispatch to individual tool handlers.
    const tools = createTools(browser);
    
    // Handle tool execution requests from MCP clients
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action but does not disclose behavioral traits like whether it requires specific permissions, if it captures the full page or viewport, error handling, or output format. This is a significant gap for a mutation-like tool.

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, clear sentence with zero waste. It is appropriately sized and front-loaded, efficiently conveying the core purpose without unnecessary details.

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 the lack of annotations and output schema, the description is incomplete. It does not address key aspects like what the screenshot returns (e.g., image data, file path), error conditions, or dependencies on page state, which are crucial for a tool with potential side effects.

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?

The input schema has 100% description coverage, documenting the optional 'filename' parameter. The description adds no additional meaning beyond the schema, such as file format or naming conventions, so it meets the baseline of 3 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?

The description clearly states the action ('take a screenshot') and the target ('current page'), which is specific and unambiguous. However, it does not distinguish this tool from the 'snapshot' sibling tool, which might have overlapping functionality, so it misses full differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives like 'snapshot' or other sibling tools. It lacks context about prerequisites, such as needing a page to be loaded, or exclusions, leaving the agent to infer usage.

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/zypin-testing/zypin-mcp'

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