glass_screenshot
Capture a native app window or a window-relative region as a lossless WebP screenshot. Handles off-screen clipping by returning the actual captured size.
Instructions
Capture the app window (or an optional window-relative region) as a screenshot (lossless WebP image). A capture reaching off the display edge is clipped to the on-screen portion — the returned width/height are the actual captured size, so a frame smaller than the window/region means it was clipped; only a fully off-screen surface errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | Optional window-relative sub-rectangle to capture; omit for the whole window. | |
| window_id | No | Capture/observe this window (id from `glass_list_windows`) instead of the active one, without changing which window subsequent ops target. Omit for the active window. |