browser_snapshot
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
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Save snapshot to markdown file instead of returning it in the response. |
Implementation Reference
- src/tools/snapshot.ts:33-36 (handler)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(); },
- src/tools/snapshot.ts:25-31 (schema)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, ];
- src/browserServerBackend.ts:48-50 (registration)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); }
- src/loopTools/snapshot.ts:29-31 (handler)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); },