Wait for Screen Change
wait_for_changeWait until part of the screen changes, settles, or shows (or loses) some text, instead of guessing a sleep. Returns the elapsed time, changed regions (screenshot pixels; add origin for desktop), and the final state.
Instructions
Wait until part of the screen changes, settles, or shows (or loses) some text, instead of guessing a sleep. Returns the elapsed time, changed regions (screenshot pixels; add origin for desktop), and the final state.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target": "<target>"
},
"name": "wait_for_change"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gone | No | Mode text: wait until it disappears instead. | |
| keep | No | Keep the final screenshot on disk and return its path (default false). | |
| mode | No | change (default): return once it differs from the start. settle: once it has been still for settleSec. text: once text appears (OCR, re-read only after a change). | |
| text | No | Mode text: what to wait for; tolerates OCR misreads. | |
| regex | No | Mode text: text is a regex. | |
| target | Yes | What to watch: full | monitor:<i> | window:<title> (or exe=/hwnd=) | region:<x>,<y>,<w>,<h>. | |
| backend | No | wgc: watch a window even when covered (window: targets; 1-2 s per check). | |
| settleSec | No | Mode settle: seconds of stillness (default 1). | |
| exactTitle | No | window: targets match the whole title only (default false). | |
| intervalMs | No | Pause between checks in ms (default 250; 1000 with wgc). | |
| timeoutSec | No | Give up after this many seconds (default 30; a timeout is a result, not an error). | |
| returnImage | No | Return the final state inline (default true). | |
| pixelThreshold | No | Mean 0-255 difference for a ~32x32 cell to count as changed (default 12). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| origin | Yes | ||
| outcome | Yes | ||
| regions | Yes | ||
| elapsedSec | Yes |