screenshot
Capture a screenshot of the current webpage using AutoProbeMCP. Optional full-page or custom save path support for flexible usage in browser automation tasks.
Instructions
Take a screenshot of the current page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fullPage | No | Capture full scrollable page | |
| path | No | Path to save screenshot (optional) |
Implementation Reference
- src/index.ts:519-542 (handler)Handler for the 'screenshot' tool: validates args with ScreenshotSchema, captures screenshot of current page using Playwright (fullPage and path options), returns success message with buffer size or save path.case 'screenshot': { if (!currentPage) { throw new Error('No browser page available. Launch a browser first.'); } const params = ScreenshotSchema.parse(args); const buffer = await currentPage.screenshot({ fullPage: params.fullPage, path: params.path }); const result = params.path ? `Screenshot saved to: ${params.path}` : `Screenshot captured (${buffer.length} bytes)`; return { content: [ { type: 'text', text: result } ] }; }
- src/index.ts:39-42 (schema)Zod schema for 'screenshot' tool inputs: fullPage (boolean, default false), path (optional string to save screenshot).const ScreenshotSchema = z.object({ fullPage: z.boolean().default(false), path: z.string().optional() });
- src/index.ts:219-236 (registration)Tool registration in ListToolsResponse: defines name 'screenshot', description, and inputSchema matching the Zod schema.{ name: 'screenshot', description: 'Take a screenshot of the current page', inputSchema: { type: 'object', properties: { fullPage: { type: 'boolean', default: false, description: 'Capture full scrollable page' }, path: { type: 'string', description: 'Path to save screenshot (optional)' } } } },