Skip to main content
Glama

glass_wait_for_region

Read-only

Wait for a screen region to change or match a saved baseline, returning match status, change percentage, bounding box, and elapsed time. Use it to pause automation until a visual transition completes or times out.

Instructions

Wait for pixel transition completion: changes from the initial frame or matches a saved baseline (required for matches). Returns matched, changed_pct, bbox and elapsed_ms as text; include_image opts into an image on match. Timeout returns matched:false. Does not prove semantics or subsequent quiescence; use a settle action for the latter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo"perceptual" (default) or "exact".
untilNo"changes" (default; diverge from reference) or "matches" (converge to baseline).
ignoreNoWindow-relative excluded rects intersected with region. Off-area rects clamp/drop silently; check ignored_pixels. changed_pct uses remaining pixels.
regionNoWindow-relative sub-rectangle to watch; omit for the whole window.
baselineNoSaved baseline name to compare against; omit to use the frame at call start.
max_widthNoMaximum returned image width; shrinks after crop, preserving native comparison pixels.
thresholdNoPerceptual sensitivity (default 0.1; smaller = stricter).
toleranceNoExact per-channel tolerance (default 0).
window_idNoObserve this current glass_list_windows ID without selecting it; omit for active window.
max_heightNoMaximum returned image height; omit both limits for native output.
timeout_msNoGive up after this long (default 10000ms); returns `{matched:false}`.
interval_msNoPoll interval (default 100ms).
include_imageNoOn match, also return the watched region as an image (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv1.8.0
    • changedInput schema / $defs / RegionArgs / properties / height / description
      Previous value: -"Height in pixels, extending down from `y`."New value: +"Height in pixels."
    • changedInput schema / $defs / RegionArgs / properties / width / description
      Previous value: -"Width in pixels, extending right from `x`."New value: +"Width in pixels."
    • changedInput schema / $defs / RegionArgs / properties / x / description
      Previous value: -"Left edge in pixels, window-relative — 0 is the window's left edge, not the screen's."New value: +"Left edge in window-relative pixels."
    • changedInput schema / $defs / RegionArgs / properties / y / description
      Previous value: -"Top edge in pixels, window-relative — 0 is the window's top edge, not the screen's."New value: +"Top edge in window-relative pixels."
    • changedInput schema / properties / ignore / description
      Previous value: -"Window-relative rectangles to exclude from the comparison. Use for\nperpetually animating content — a blinking text caret, a clock, a\nspinner — which otherwise keeps `changed_pct` permanently non-zero.\n`changed_pct` is measured over the pixels that remain. Combines with\n`region`: rects are always window-relative and are intersected with it.\nA rect that falls partially or entirely outside the compared area —\nthe frame, or the `region` sub-rectangle when one is set — is silently\nclamped or dropped, masking less than requested or nothing at all; the\nexcluded count is reported as `ignored_pixels`, so a smaller-than-\nexpected value flags a misplaced rect."New value: +"Window-relative excluded rects intersected with region. Off-area rects clamp/drop silently; check ignored_pixels. changed_pct uses remaining pixels."
    • addedInput schema / properties / max_height
      Added value: +{
      +  "description": "Maximum returned image height; omit both limits for native output.",
      +  "format": "uint32",
      +  "maximum": 4294967295,
      +  "minimum": 1,
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / max_width
      Added value: +{
      +  "description": "Maximum returned image width; shrinks after crop, preserving native comparison pixels.",
      +  "format": "uint32",
      +  "maximum": 4294967295,
      +  "minimum": 1,
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / window_id / description
      Previous value: -"Capture/observe this window (id from `glass_list_windows`) instead of the\nactive one, without changing which window subsequent ops target. Omit for\nthe active window."New value: +"Observe this current glass_list_windows ID without selecting it; omit for active window."
  2. Addedv1.2.0
  3. Removedv1.1.0
  4. Addedv1.0.3

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds valuable behavioral context beyond that: it explains the return values (matched, changed_pct, bbox, elapsed_ms), the timeout behavior (returns matched:false), the include_image opt-in, and the limitation that it does not prove semantics or quiescence. This is rich, honest behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the core purpose is in the first sentence, followed by return values, opt-in behavior, timeout behavior, and a clear limitation with an alternative. Every sentence earns its place; no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter tool with no output schema, the description covers the key behavioral aspects: what it returns, timeout semantics, the baseline requirement, and the limitation. It doesn't enumerate every parameter, but the schema already does that. The only minor gap is that it doesn't explain the difference between 'perceptual' and 'exact' modes, but the schema covers that. Overall, complete enough for an agent to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 13 parameters. The description adds some semantic context (e.g., 'changes from the initial frame or matches a saved baseline', 'include_image opts into an image on match', 'Timeout returns matched:false'), but it does not systematically explain each parameter's meaning beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('wait for'), a precise resource ('pixel transition completion'), and the two modes ('changes' vs 'matches'). It also names the sibling it is not ('use a settle action for the latter'), which distinguishes it from glass_wait_stable. This is a clear, specific definition.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use this tool: wait for pixel transition completion, and when not: 'Does not prove semantics or subsequent quiescence; use a settle action for the latter.' It also explains the 'matches' mode requires a saved baseline. This gives the agent clear routing guidance relative to alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.