interceptor_chrome_devtools_snapshot
Capture accessibility snapshots from Chrome DevTools sessions to analyze web content structure and compliance for testing and debugging purposes.
Instructions
Take an accessibility snapshot from the bound Chrome DevTools session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| devtools_session_id | Yes | Session ID from interceptor_chrome_devtools_attach | |
| verbose | No | Include full a11y tree details |
Implementation Reference
- src/tools/devtools.ts:630-660 (handler)Implementation of the interceptor_chrome_devtools_snapshot tool handler.
server.tool( "interceptor_chrome_devtools_snapshot", "Take an accessibility snapshot from the bound Chrome DevTools session.", { devtools_session_id: z.string().describe("Session ID from interceptor_chrome_devtools_attach"), verbose: z.boolean().optional().default(false).describe("Include full a11y tree details"), }, async ({ devtools_session_id, verbose }) => { try { const { targetId } = await ensureSessionTargetIsAlive(devtools_session_id); const devtoolsResult = await devToolsBridge.callAction( devtools_session_id, "snapshot", { verbose }, ); return { content: [{ type: "text", text: truncateResult({ status: "success", devtools_session_id, target_id: targetId, devtoolsResult: sanitizeDevToolsPayload(devtoolsResult), }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: errorToString(e) }) }] }; } }, );