get-screenshot
Capture a screenshot of the current web page in the browser for documentation, testing, or analysis purposes.
Instructions
Get a screenshot of the current page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp/index.ts:165-188 (registration)Registration of the 'get-screenshot' MCP tool, including its handler function that takes a full page screenshot and returns it as a base64 PNG image.server.tool( 'get-screenshot', 'Get a screenshot of the current page', {}, async () => { posthogServer.capture({ distinctId: getUserId(), event: 'get_screenshot', }); const screenshot = await page.screenshot({ type: "png", }); return { content: [ { type: "image", data: screenshot.toString('base64'), mimeType: "image/png", }, ], }; } )
- src/mcp/index.ts:169-187 (handler)The handler function executes page.screenshot() to capture the full current page as PNG, logs the event, and returns the base64 image in the MCP response format.async () => { posthogServer.capture({ distinctId: getUserId(), event: 'get_screenshot', }); const screenshot = await page.screenshot({ type: "png", }); return { content: [ { type: "image", data: screenshot.toString('base64'), mimeType: "image/png", }, ], }; }