Skip to main content
Glama

glass_wait_for_element

Read-only

Wait for a UI element to reach a specified state (appears, enabled, visible, etc.) and return its details, handling apps that haven't published accessibility trees yet.

Instructions

Block until a UI element reaches a precise state, then return it as text (no image). Select by name (accessible-name substring) and/or role (e.g. "Button"); condition (default appears): appears|disappears|enabled|disabled|checked|unchecked|selected|unselected|expanded|collapsed|focused|visible|hidden; optional value_contains. Returns {matched,elapsed_ms,element{id,role,name,bounds,states}} — the id is usable with glass_click_element. On timeout returns {matched:false}. Waits through a just-launched app that has not published its accessibility tree yet, and errors if none appeared before the timeout. Collapses screenshot poll-loops into one call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoSubstring of the element's accessible name (selector).
roleNoElement role filter, e.g. "Button", "ProgressBar" (selector).
conditionNoWhat to wait for (default "appears"): appears|disappears|enabled|disabled| checked|unchecked|selected|unselected|expanded|collapsed|focused|visible|hidden. `checked`/`unchecked` only match a checkable element (one exposing a real toggle state) — a non-toggle element matches neither.
timeout_msNoGive up after this long (default 10000ms); returns `{matched:false}`.
interval_msNoPoll interval (default 200ms — an a11y snapshot per tick).
value_containsNoAdditionally require the matched element's `value` to contain this substring. Not a standalone selector — `name` and/or `role` is still required.
Behavior5/5

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

The description goes far beyond the readOnlyHint annotation by disclosing timeout behavior ({matched:false}), error behavior when no element appeared, the returned JSON shape with an id usable in glass_click_element, and that it waits through a just-launched app's accessibility tree publication. These are substantive behavioral traits an agent needs.

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?

Every sentence carries load-bearing information: purpose, selectors, condition list, return shape, id reuse, timeout semantics, launch-wait behavior, and the anti-pattern it replaces. There is no fluff or repetition, and the most critical facts are front-loaded.

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

Completeness5/5

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

Despite having no output schema, the description fully covers return values, failure/timeout modes, selector constraints, and post-return usage of the element id. The schema covers per-parameter details like interval_ms and timeout_ms defaults, so nothing critical is missing for an agent to invoke the tool 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 coverage is 100%, and the schema already documents every parameter in detail, including defaults, enums, and the non-standalone constraint on value_contains. The description briefly restates conditions and the default but adds little beyond what the schema provides, so the baseline of 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 opens with a specific verb and resource: 'Block until a UI element reaches a precise state, then return it as text (no image).' It clearly defines the object of the wait (an accessible UI element), the action (blocking/waiting), and the output modality (text, not image), which distinguishes it from screenshot-based wait tools.

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 clear context: selectors must be name/role, condition defaults to appears, and the tool collapses screenshot poll-loops into one call. It does not explicitly state when not to use this tool or point to alternatives like glass_wait_stable or glass_wait_for_region, but the use case is well grounded.

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