Wait For Screen Change
wait_for_changePolls the screen and returns as soon as a change is detected or timeout elapses, so clients can wait for a process to finish without constant checks.
Instructions
Long-poll the screen and return as soon as the perceptual-hash distance from the start frame ≥ threshold, or when the timeout elapses. Useful for 'ping me when X finishes' workflows — the server does the polling so the client only spends a turn when something actually changed. Returns an image on change, or a no-image diagnostics text on timeout. Polling is CPU-light (dHash on a 9x8 downscale). Hard timeout cap is 5 minutes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format. Default jpeg. | |
| pollMs | No | Polling interval in ms. Default 500, min 200. Lower = more CPU + more responsive. Higher = cheaper + slower reaction. | |
| maxEdge | No | Resize so longest edge ≤ N px when image is returned. Default 1600. | |
| quality | No | Quality (1-100) for jpeg/webp. | |
| cacheKey | No | Cache key (shared with screenshot_if_changed / get_screen_diff). If a baseline exists for this key, change is measured against it; otherwise the first capture becomes the reference. | |
| displayId | No | Display id from `list_displays`. Omit for primary. | |
| threshold | No | Hamming distance threshold (1-64). Returns image as soon as distance from start frame ≥ threshold. Default 8. | |
| timeoutMs | No | Max time to wait for a change before returning a no-change result. Default 30s, hard cap 300s. Long-blocks the MCP transport — keep ≤ 5 min so the client doesn't time out. |