Skip to main content
Glama
Angeluis001

Playwright MCP

by Angeluis001

browser_snapshot

Read-only

Capture structured accessibility snapshots of web pages for automated testing and content analysis, providing detailed page information without screenshots.

Instructions

Capture accessibility snapshot of the current page, this is better than screenshot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoSave snapshot to markdown file instead of returning it in the response.

Implementation Reference

  • Handler function for the browser_snapshot tool. Ensures a tab is active and instructs to capture an accessibility snapshot of the page.
    handle: async context => {
      await context.ensureTab();
    
      return {
        code: [`// <internal code to capture accessibility snapshot>`],
        captureSnapshot: true,
        waitForNetwork: false,
      };
    },
  • Schema definition for the browser_snapshot tool, including name, description, empty input schema, and readOnly type.
    schema: {
      name: 'browser_snapshot',
      title: 'Page snapshot',
      description: 'Capture accessibility snapshot of the current page, this is better than screenshot',
      inputSchema: z.object({}),
      type: 'readOnly',
  • Tool registration using defineTool, defining the browser_snapshot tool with its schema and handler.
    const snapshot = defineTool({
      capability: 'core',
      schema: {
        name: 'browser_snapshot',
        title: 'Page snapshot',
        description: 'Capture accessibility snapshot of the current page, this is better than screenshot',
        inputSchema: z.object({}),
        type: 'readOnly',
      },
    
      handle: async context => {
        await context.ensureTab();
    
        return {
          code: [`// <internal code to capture accessibility snapshot>`],
          captureSnapshot: true,
          waitForNetwork: false,
        };
      },
    });
  • src/tools.ts:35-50 (registration)
    Main registration of tools including those from snapshot.ts (browser_snapshot) into the snapshotTools array.
    export const snapshotTools: Tool<any>[] = [
      ...common(true),
      ...console,
      ...dialogs(true),
      ...files(true),
      ...install,
      ...keyboard(true),
      ...navigate(true),
      ...network,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs(true),
      ...testing,
      ...wait(true),
    ];
  • Module export including the snapshot tool for import into main tools list.
    export default [
      snapshot,
      click,
      drag,
      hover,
      type,
      selectOption,
    ];
Behavior3/5

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

Annotations provide readOnlyHint=true, destructiveHint=false, and openWorldHint=true, indicating a safe, non-destructive operation. The description adds context by specifying it captures an 'accessibility snapshot,' which suggests it might include metadata like ARIA roles or contrast ratios, beyond a visual screenshot. However, it doesn't detail what exactly is captured, the format, or any behavioral traits like rate limits or permissions. With annotations covering safety, the description adds some value but lacks rich behavioral disclosure.

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: 'Capture accessibility snapshot of the current page, this is better than screenshot.' It's front-loaded with the core purpose and adds a comparative note without waste. Every part earns its place, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's complexity (capturing accessibility data), annotations provide safety hints, but there's no output schema. The description hints at the output being an 'accessibility snapshot' but doesn't explain return values, format, or what makes it 'better.' For a tool with potential rich output and no output schema, the description is incomplete, leaving gaps in understanding the result.

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

Parameters4/5

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

There is 1 parameter with 100% schema description coverage, so the schema fully documents the 'filename' parameter. The description doesn't add any parameter-specific information, which is acceptable given the high coverage. Since there's only one optional parameter, the baseline is 4, as the description doesn't need to compensate for gaps, and it's not misleading.

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 tool's purpose: 'Capture accessibility snapshot of the current page' with a specific verb ('capture') and resource ('accessibility snapshot'). It distinguishes from the sibling 'browser_take_screenshot' by noting 'this is better than screenshot,' though it doesn't explicitly name the sibling. The purpose is clear but could be more explicit about the distinction.

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?

The description implies usage by contrasting with 'screenshot' (likely referring to 'browser_take_screenshot'), suggesting it's preferred for accessibility purposes. However, it doesn't explicitly state when to use this tool versus alternatives like 'browser_take_screenshot' or other siblings, nor does it provide context on prerequisites or exclusions. The guidance is implied but not comprehensive.

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/Angeluis001/playwright-mcp'

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