interceptor_chrome_devtools_screenshot
Capture screenshots from Chrome DevTools sessions to document network traffic analysis or debugging scenarios during proxy-based interception.
Instructions
Take a screenshot using the bound Chrome DevTools session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| devtools_session_id | Yes | Session ID from interceptor_chrome_devtools_attach | |
| file_path | No | Optional path to save screenshot | |
| format | No | Image format | |
| full_page | No | Capture the full page | |
| quality | No | Compression quality for jpeg/webp |
Implementation Reference
- src/tools/devtools.ts:741-777 (handler)The handler for 'interceptor_chrome_devtools_screenshot' which takes a screenshot using a bound Chrome DevTools session and optionally saves it to a file.
"interceptor_chrome_devtools_screenshot", "Take a screenshot using the bound Chrome DevTools session.", { devtools_session_id: z.string().describe("Session ID from interceptor_chrome_devtools_attach"), file_path: z.string().optional().describe("Optional path to save screenshot"), format: z.enum(["png", "jpeg", "webp"]).optional().describe("Image format"), full_page: z.boolean().optional().default(false).describe("Capture the full page"), quality: z.number().optional().describe("Compression quality for jpeg/webp"), }, async ({ devtools_session_id, file_path, format, full_page, quality }) => { try { const { targetId } = await ensureSessionTargetIsAlive(devtools_session_id); const args: Record<string, unknown> = {}; if (file_path) args.filePath = file_path; if (format) args.format = format; if (full_page) args.fullPage = true; if (quality !== undefined) args.quality = quality; const devtoolsResult = await devToolsBridge.callAction(devtools_session_id, "screenshot", args); const screenshot = await persistScreenshotIfRequested(devtoolsResult, file_path); return { content: [{ type: "text", text: truncateResult({ status: "success", devtools_session_id, target_id: targetId, devtoolsResult: sanitizeDevToolsPayload(devtoolsResult), ...screenshot, }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: errorToString(e) }) }] }; } }, );