ghost_screenshot
Capture a window, element, or screen region as a compressed JPEG (or lossless PNG) for agent visual checks. Works even on covered or hidden windows; crop by name, role, or coordinates.
Instructions
Capture a screenshot of the window the agent is working in. Target = window= or the session anchor: that window is captured BY HANDLE (works while covered, on a hidden desktop, or via CDP for a routed browser) at max 768px JPEG q=75 (~20-100KB). Only with no anchor does it fall back to the foreground window. Pass name/role to crop to ONE element inside the target, or rect=[l,t,r,b] (great for VLM-in-the-loop checks). full=true: the whole screen at max 1280px JPEG (max_dim=0 = native-res lossless PNG). Always includes size_bytes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| full | No | Full-screen capture (default false) | |
| name | No | Crop to the element with this accessible name | |
| rect | No | Crop to [left,top,right,bottom] region | |
| role | No | Crop to the element with this role | |
| window | No | Title substring of the window to capture (anchors it). Omit to use the anchor. | |
| max_dim | No | Longest-edge resize (default 768; 1280 with full=true; 0 = no resize, lossless PNG) | |
| foreground | No | Only without a window/anchor: crop to the foreground window (default true) | |
| jpeg_quality | No |