Skip to main content
Glama
nzjami

Playwright MCP

by nzjami

browser_snapshot

Read-only

Capture structured accessibility snapshots of web pages for analysis and testing, 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

  • Core handler implementation for the 'browser_snapshot' tool. Ensures an active tab and sets the response to include an accessibility snapshot of the current page.
    handle: async (context, params, response) => {
      await context.ensureTab();
      response.setIncludeSnapshot();
    },
  • Schema definition for the 'browser_snapshot' tool, which takes no input parameters and is marked as readOnly.
    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',
    },
  • src/tools.ts:36-52 (registration)
    Registration of all tools including the snapshot module (containing browser_snapshot) in the allTools array used by the BrowserServerBackend.
    export const allTools: Tool<any>[] = [
      ...common,
      ...console,
      ...dialogs,
      ...evaluate,
      ...files,
      ...install,
      ...keyboard,
      ...navigate,
      ...network,
      ...mouse,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs,
      ...wait,
    ];
  • The ServerBackend.tools() method that exposes the schemas of all registered tools, including browser_snapshot, to the MCP server for listTools requests.
    tools(): mcpServer.ToolSchema<any>[] {
      return this._tools.map(tool => tool.schema);
    }
  • LoopTools-specific handler for 'browser_snapshot' that delegates to context.runTask to capture the snapshot.
    handle: async (context, params) => {
      return await context.runTask('Capture browser snapshot', true);
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.0
    • addedInput schema / properties / filename
      Added value: +{
      +  "description": "Save snapshot to markdown file instead of returning it in the response.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=true, destructiveHint=false, and openWorldHint=true, which the description doesn't contradict. The description adds valuable context beyond annotations by specifying it captures an 'accessibility snapshot' (implying structured data like ARIA roles or text content) and notes it can save to a markdown file via the filename parameter. However, it doesn't detail behavioral aspects like rate limits, authentication needs, or exact output format, keeping the score from being a 5.

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 that front-loads the core purpose ('Capture accessibility snapshot of the current page') and adds a comparative note ('this is better than screenshot'). There is no wasted text, and it effectively communicates key information in a compact form, making it easy for an agent to parse quickly.

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 the tool's moderate complexity (1 parameter, no output schema), the description is reasonably complete. It clarifies the tool's purpose and distinguishes it from a sibling, with annotations covering safety and scope. However, it could be more complete by explaining what an 'accessibility snapshot' includes (e.g., HTML structure, ARIA attributes) or when to prefer it over other tools, slightly reducing the score.

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 1 parameter with 100% description coverage, documenting that 'filename' saves the snapshot to a markdown file instead of returning it in the response. The description adds no additional parameter semantics beyond this, as it doesn't explain the filename usage or format further. With high schema coverage, the baseline is 3, and the description doesn't compensate with extra details.

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 captures an accessibility snapshot of the current page, specifying both the action (capture) and resource (accessibility snapshot of current page). It distinguishes from the sibling 'browser_take_screenshot' by noting this is 'better than screenshot,' though it doesn't fully explain how it differs functionally. The purpose is specific but could be more explicit about what an 'accessibility snapshot' entails compared to a regular screenshot.

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 stating this is 'better than screenshot,' suggesting it as an alternative to 'browser_take_screenshot' for accessibility-focused captures. However, it lacks explicit guidance on when to use this tool versus others (e.g., for accessibility testing vs. visual documentation) or any prerequisites. The context is implied but not clearly defined, leaving some ambiguity for the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.