Screenshot If Changed
screenshot_if_changedCapture the screen only when its visual content changes from the cached baseline; otherwise return diagnostics with no image tokens.
Instructions
Capture the screen only if it has changed (perceptual-hash dHash distance ≥ threshold) since the last call with the same cacheKey. Otherwise returns just diagnostics — no image, no vision tokens. Makes polling / 24h monitoring economically viable: static screens cost 0 image tokens. First call always returns the image (reason=no_baseline). Use pinBaseline=true to keep the reference point fixed across calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format. Default jpeg. | |
| maxEdge | No | Resize so longest edge ≤ N px when image is returned. Default 1600. | |
| quality | No | Quality (1-100) for jpeg/webp. | |
| cacheKey | No | Override cache key. Default = displayId. Use distinct keys when polling different regions or contexts. | |
| displayId | No | Display id from `list_displays`. Omit for primary. | |
| threshold | No | Hamming distance threshold (1-64). Image returned only if distance from cached baseline ≥ threshold. Default 8. Calibration: 0-5 = identical, 6-10 = small change, 11-20 = notable, 21+ = different scene. threshold=64 effectively disables change detection (the screen would have to differ in every bit). | |
| pinBaseline | No | If true, do NOT update the cached baseline after this call. Use when comparing against a fixed reference (e.g. 'diff vs t=0'). Default false (baseline rolls forward each call). The first call with a new cacheKey always establishes the pinned baseline. |