pilot_screenshot
Take a PNG screenshot of a webpage or specific element, saving it to disk with support for full page, viewport, element ref, and clip region.
Instructions
Take a PNG screenshot of the current page or a specific element. Use when the user wants to capture what the page looks like visually, save a screenshot to disk, or capture a specific element's appearance. For a visual debug overlay with ref labels, use pilot_annotated_screenshot instead.
Parameters:
ref: Element reference from snapshot (e.g., "@e3") or CSS selector to screenshot a specific element (omit for full page)
full_page: Set to false for viewport-only capture (default: true, captures the entire scrollable page)
output_path: File path to save the screenshot (default: /tmp/pilot-screenshot.png). Must be within the allowed output directory
clip: Crop region as {x, y, width, height} pixel coordinates for a specific area of the page
Returns: The screenshot as a base64 PNG image and the file path where it was saved.
Errors:
"Output path must be within ...": The path is outside the allowed directory. Set PILOT_OUTPUT_DIR or use /tmp.
"Element not found": The ref is stale. Run pilot_snapshot to get fresh refs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element ref or CSS selector to screenshot | |
| full_page | No | Capture full page (default: true) | |
| output_path | No | Output file path | |
| clip | No | Clip region {x, y, width, height} |