Skip to main content
Glama

glass_wait_for_region

Read-only

Block until a screen region changes or matches a saved baseline, then return change metrics. Use to sync UI tests or confirm a design without processing images.

Instructions

Block until a visual region changes (diverges from a reference) or matches (converges to a saved baseline), then return text metrics (no image unless include_image:true). until: "changes" (default) or "matches" (needs baseline); optional window-relative region; mode perceptual|exact with threshold/tolerance. Returns {matched,changed_pct,bbox,elapsed_ms}. Use "matches" to confirm the UI reached an approved design without spending vision tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo"perceptual" (default) or "exact".
untilNo"changes" (default; diverge from reference) or "matches" (converge to baseline).
ignoreNoWindow-relative rectangles to exclude from the comparison. Use for perpetually animating content — a blinking text caret, a clock, a spinner — which otherwise keeps `changed_pct` permanently non-zero. `changed_pct` is measured over the pixels that remain. Combines with `region`: rects are always window-relative and are intersected with it. A rect that falls partially or entirely outside the compared area — the frame, or the `region` sub-rectangle when one is set — is silently clamped or dropped, masking less than requested or nothing at all; the excluded count is reported as `ignored_pixels`, so a smaller-than- expected value flags a misplaced rect.
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.
thresholdNoPerceptual sensitivity (default 0.1; smaller = stricter).
toleranceNoExact per-channel tolerance (default 0).
window_idNoCapture/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.
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).
Behavior4/5

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

The description is transparent about the blocking behavior, timeout (returns {matched:false}), and the fact that it returns text metrics unless include_image is set. It also explains side effects of window_id (does not change target window) and the interplay of ignore regions with changed_pct. The readOnlyHint annotation is consistent—this tool does not modify UI state—so there is no contradiction.

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

Conciseness4/5

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

The description is dense but well-structured, packing key information about parameters, defaults, and return format into a single coherent paragraph. It avoids redundant repetition and flows logically from action to parameters to use case. While it is lengthy, it is appropriate for the tool's complexity and does not include superfluous content.

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?

Given there is no output schema, the description sufficiently describes the return object {matched,changed_pct,bbox,elapsed_ms} and the condition for a false match (timeout). It covers edge cases such as clamping of ignored rectangles and the need for baseline in 'matches' mode. Minor gaps remain, such as error handling for missing baselines, but overall it provides enough context for correct usage.

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

Parameters4/5

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

Even though the schema covers 100% of parameters with descriptions, the tool description adds meaningful semantic value beyond the schema. It clarifies relationships (e.g., 'until matches needs baseline', 'mode perceptual|exact with threshold/tolerance') and explains default behaviors. It also describes the effect of ignore regions on changed_pct measurement, which is not fully captured in the individual parameter descriptions.

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 clearly states the tool's purpose with a specific verb: 'Block until a visual region changes or matches, then return text metrics.' It distinguishes this tool from sibling wait tools (e.g., glass_wait_for_element, glass_wait_for_log) by targeting visual regions and comparing against baselines. The inclusion of usage direction ('Use "matches" to confirm the UI reached an approved design') reinforces the intent.

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

Usage Guidelines4/5

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

The description provides concrete usage guidance, such as using 'matches' to confirm a UI state without spending vision tokens, and explains parameter combinations like 'until matches needs baseline.' It implicitly differentiates from alternatives by focusing on visual region changes rather than element presence or logs, though it does not explicitly enumerate 'when not to use.' Overall, it gives enough context for an agent to choose appropriately.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fixed-width/glass'

If you have feedback or need assistance with the MCP directory API, please join our Discord server