Skip to main content
Glama

browser_snapshot

Read-only

Capture accessibility snapshots of web pages to analyze content structure without screenshots, enabling automated web interaction through structured data.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary implementation of the browser_snapshot tool, including schema and handler. The handler ensures a tab is active and flags the response to include an accessibility snapshot of the page.
    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, params, response) => {
        await context.ensureTab();
        response.setIncludeSnapshot();
      },
    });
  • src/tools.ts:36-52 (registration)
    Registers the browser_snapshot tool (via ...snapshot) along with other tools in the allTools array, which is used to expose tools to the MCP server.
    export const allTools: Tool<any>[] = [
      ...common,
      ...console,
      ...dialogs,
      ...evaluate,
      ...files,
      ...install,
      ...keyboard,
      ...navigate,
      ...network,
      ...mouse,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs,
      ...wait,
    ];
  • Secondary handler for browser_snapshot in loopTools context, which delegates to context.runTask to capture snapshot via LLM loop.
    export const snapshot = defineTool({
      schema: {
        name: 'browser_snapshot',
        title: 'Take a snapshot of the browser',
        description: 'Take a snapshot of the browser to read what is on the page.',
        inputSchema: z.object({}),
        type: 'readOnly',
      },
    
      handle: async (context, params) => {
        return await context.runTask('Capture browser snapshot', true);
      },
    });
  • Registers the browser_snapshot tool (snapshot) in the LoopToolsServerBackend tools list for the loop tools MCP server.
    private _tools: Tool<any>[] = [perform, snapshot];

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already indicate readOnlyHint=true, destructiveHint=false, and openWorldHint=true, covering safety and scope. The description adds value by specifying it captures an 'accessibility snapshot' (implying structured data like ARIA attributes) rather than a visual image, which is useful context beyond annotations. However, it doesn't detail output format or potential limitations.

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 brief comparative note. Every word serves a purpose, with no wasted text, 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 0 parameters, rich annotations (readOnlyHint, destructiveHint, openWorldHint), and no output schema, the description is adequate but could be more complete. It explains what the tool does but doesn't clarify the output (e.g., what an 'accessibility snapshot' contains) or tie into the sibling tools effectively, leaving some gaps in context.

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 are 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary information.

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 verb ('capture') and resource ('accessibility snapshot of the current page'), making the purpose specific and understandable. However, it doesn't explicitly distinguish this from the sibling 'browser_take_screenshot' tool beyond saying 'this is better than screenshot,' which is somewhat vague rather than a clear 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 minimal guidance by implying this tool is preferable to 'browser_take_screenshot' for accessibility purposes, but it doesn't specify when to use it (e.g., for accessibility testing vs. visual capture) or when not to use it. No explicit alternatives or prerequisites are mentioned, leaving usage context unclear.

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