save_unmarked_screenshot
Capture a clean screenshot without annotations or bounding boxes for unobstructed page viewing. Save it as a resource for later reference.
Instructions
Capture a screenshot without bounding boxes and store it as a resource. Provide a resourceName to identify the screenshot. It's useful for when you want to view a page unobstructed by annotations or the user asks for a screenshot of the page.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resourceName | No | The name under which the unmarked screenshot will be saved as a resource (e.g. 'before_login'). If not provided, one will be generated. |
Implementation Reference
- src/index.ts:871-899 (handler)The function that implements the core logic of the 'save_unmarked_screenshot' tool. It optionally generates a resourceName, unmarks the page to remove bounding boxes, captures a screenshot, stores it in the 'screenshots' map, and returns a success message with the resource URI.async function handleSaveUnmarkedScreenshot( page: Page, args: any ): Promise<CallToolResult> { let { resourceName } = args; if (!resourceName) { resourceName = `unmarked_screenshot_${Date.now()}`; } // Unmark the page to remove bounding boxes await page.evaluate(() => { if (typeof (window as any).unmarkPage === "function") { (window as any).unmarkPage(); } }); const buffer = await page.screenshot(); screenshots.set(resourceName, Buffer.from(buffer)); return { isError: false, content: [ { type: "text", text: `Unmarked screenshot saved as resource screenshot://${resourceName}`, }, ], }; }
- src/index.ts:585-595 (schema)Input schema definition for the tool, specifying an optional 'resourceName' parameter of type string.inputSchema: { type: "object", properties: { resourceName: { type: "string", description: "The name under which the unmarked screenshot will be saved as a resource (e.g. 'before_login'). If not provided, one will be generated.", }, }, required: [], },
- src/index.ts:581-596 (registration)The tool registration entry in the TOOLS array, including name, description, and inputSchema, which is returned by the ListTools MCP handler.{ name: "save_unmarked_screenshot", description: "Capture a screenshot without bounding boxes and store it as a resource. Provide a resourceName to identify the screenshot. It's useful for when you want to view a page unobstructed by annotations or the user asks for a screenshot of the page.", inputSchema: { type: "object", properties: { resourceName: { type: "string", description: "The name under which the unmarked screenshot will be saved as a resource (e.g. 'before_login'). If not provided, one will be generated.", }, }, required: [], }, },
- src/index.ts:940-942 (helper)The switch case in the main tool dispatcher (handleToolCall) that routes calls to the specific handler function.case "save_unmarked_screenshot": result = await handleSaveUnmarkedScreenshot(page, args); break;