Skip to main content
Glama

browser_snapshot

Capture structured accessibility snapshots of web pages using browser automation, enabling detailed page analysis without relying on screenshots or visually-tuned models.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of the browser_snapshot tool, including schema and handler. The handler ensures a tab is open and sets 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 (imported from snapshot.ts at line 27) by including it in the allTools array, which is used by the server backend.
    export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ];
  • MCP ServerBackend implementation that dispatches tool calls to the specific handler (e.g., browser_snapshot) via tool.handle.
    async callTool(schema: mcpServer.ToolSchema<any>, parsedArguments: any) { const response = new Response(this._context, schema.name, parsedArguments); const tool = this._tools.find(tool => tool.schema.name === schema.name)!; await tool.handle(this._context, parsedArguments, response); if (this._sessionLog) await this._sessionLog.log(response); return await response.serialize(); }
  • MCP ServerBackend provides the tool schemas, including browser_snapshot, for listing in MCP protocol.
    tools(): mcpServer.ToolSchema<any>[] { return this._tools.map(tool => tool.schema); }
  • Secondary implementation in loopTools, likely for agent loop context, delegating to runTask for snapshot capture.
    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); }, });

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