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);
    },
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, read-only operation that doesn't modify the page. The description adds value by specifying it captures an 'accessibility snapshot' and compares it to a screenshot, but it doesn't disclose additional behavioral traits like what data is included in the snapshot, potential rate limits, or authentication needs. With annotations covering safety, the description adds some context but not rich behavioral details.

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 extremely concise with two short sentences: 'Capture accessibility snapshot of the current page, this is better than screenshot.' It's front-loaded with the core purpose and includes a comparative note. There's zero waste, and every sentence earns its place by clarifying the tool's function and differentiating it from a sibling.

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 (simple operation with 1 parameter), annotations provide safety info, and schema covers parameters fully, but there's no output schema. The description is minimal and doesn't explain what an accessibility snapshot returns or its format, which is a gap since output isn't documented elsewhere. It's adequate for a basic tool but lacks details on output behavior, making it incomplete for full understanding.

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 doesn't add any parameter semantics beyond what the schema provides, as it mentions no parameters. With high schema coverage, the baseline is 3, and the description doesn't compensate or add extra meaning.

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' specifies the verb (capture) and resource (accessibility snapshot of current page). It distinguishes from sibling 'browser_take_screenshot' by mentioning 'this is better than screenshot,' though it doesn't fully explain what an accessibility snapshot entails. The purpose is clear but could be more specific about what an accessibility snapshot includes.

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 'browser_take_screenshot' ('this is better than screenshot'), suggesting this tool is preferred for accessibility purposes over a visual screenshot. However, it doesn't explicitly state when to use this tool versus alternatives like 'browser_take_screenshot' or other browser tools, nor does it provide context on prerequisites or exclusions. The guidance is implied but lacks specificity.

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/nzjami/mcpPlaywright'

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