browser_snapshot
Capture accessibility snapshots of web pages using Playwright for enhanced testing and analysis beyond standard screenshots, integrated with Cloudflare Workers for browser automation.
Instructions
Capture accessibility snapshot of the current page, this is better than screenshot
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/snapshot.ts:33-41 (handler)The handler function for the 'browser_snapshot' tool. It ensures a tab is active and returns a response instructing the system to capture an accessibility snapshot of the page.handle: async context => { await context.ensureTab(); return { code: [`// <internal code to capture accessibility snapshot>`], captureSnapshot: true, waitForNetwork: false, }; },
- src/tools/snapshot.ts:25-31 (schema)Input schema and metadata definition for the 'browser_snapshot' tool using Zod. It has no input parameters and is marked as read-only.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:35-50 (registration)Registers the 'browser_snapshot' tool by spreading the imported 'snapshot' module into the main 'snapshotTools' array, which collects all core tools.export const snapshotTools: Tool<any>[] = [ ...common(true), ...console, ...dialogs(true), ...files(true), ...install, ...keyboard(true), ...navigate(true), ...network, ...pdf, ...screenshot, ...snapshot, ...tabs(true), ...testing, ...wait(true), ];
- src/tools/snapshot.ts:227-234 (registration)Module-level registration exporting 'browser_snapshot' (named 'snapshot') along with related browser interaction tools.export default [ snapshot, click, drag, hover, type, selectOption, ];