Skip to main content
Glama

glass_wait_for_element

Read-only

Block until an accessible element reaches a condition such as appears or enabled, optionally with a value, then return it. Verifies semantic UI state instead of screenshots.

Instructions

Wait for semantic transition completion: block until an accessible element reaches a condition and optional value, then return it as text (no image). This verifies runtime semantic state, not pixels or visual stability. Select by name (accessible-name substring), description (accessible-description substring) and/or role (e.g. "Button"); condition (default appears): appears|disappears|enabled|disabled|checked|unchecked|selected|unselected|expanded|collapsed|focused|visible|hidden; value additionally requires an exact editable value, while value_contains requires a substring (combine either with a selector). Returns {matched,elapsed_ms} plus the matched element, including value — its 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. If at least two next actions or waits are known, use glass_do instead of separate calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoSubstring of the element's accessible name (selector).
roleNoElement role filter, e.g. "Button", "ProgressBar", "Document" (selector).
valueNoExact case-sensitive accessible value, requiring another selector and excluding `value_contains`.
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}`.
descriptionNoSubstring of the element's accessible description (selector). Useful for unnamed controls whose platform label is exposed as a hint, help text, or description.
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`, `description`, and/or `role` is still required.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed4 schema fields changedv1.5.1
    • addedInput schema / properties / description
      Added value: +{
      +  "description": "Substring of the element's accessible description (selector). Useful for unnamed\ncontrols whose platform label is exposed as a hint, help text, or description.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / role / description
      Previous value: -"Element role filter, e.g. \"Button\", \"ProgressBar\" (selector)."New value: +"Element role filter, e.g. \"Button\", \"ProgressBar\", \"Document\" (selector)."
    • addedInput schema / properties / value
      Added value: +{
      +  "description": "Exact case-sensitive accessible value, requiring another selector and excluding `value_contains`.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / value_contains / description
      Previous value: -"Additionally require the matched element's `value` to contain this substring.\nNot a standalone selector — `name` and/or `role` is still required."New value: +"Additionally require the matched element's `value` to contain this substring.\nNot a standalone selector — `name`, `description`, and/or `role` is still required."
  2. Addedv1.2.0
  3. Removedv1.0.3
  4. First observedv1.0.1

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only supply readOnlyHint=true; the description alone discloses the blocking behavior, the return contract ({matched,elapsed_ms} plus matched element, and {matched:false} on timeout), the error case ('errors if none appeared before the timeout'), the just-launched-app edge case, and that the returned id is reusable with glass_click_element. This is rich behavioral context well beyond the annotations, with 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?

Purpose is front-loaded and every sentence carries a distinct fact: selector rules, condition enum, return shape, timeout semantics, unready-app handling, and glass_do routing — there is no fluff. It runs long and the condition enum restates the schema, but the density is justified for an 8-parameter wait tool.

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?

With no output schema, the description carries the full return contract and does so completely: matched/elapsed_ms, element with value, id reuse, timeout shape, and the error case. Combined with 100%-covered parameters and readOnlyHint, nothing an agent needs to invoke it correctly is missing.

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 covers 100% of the 8 parameters, so the baseline is 3. The description restates selector semantics (substrings, role filter) and the rule that value/value_contains must combine with a selector, adding only minor nuance such as 'value' requiring an 'exact editable value' — most of this repeats what the schema already documents.

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?

Opens with a specific verb and resource: 'Wait for semantic transition completion: block until an accessible element reaches a condition and optional value, then return it as text (no image).' It also scopes itself against siblings by asserting it verifies 'runtime semantic state, not pixels or visual stability,' clearly separating it from glass_wait_stable and screenshot-based 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?

Gives an explicit when-not with a named alternative: 'If at least two next actions or waits are known, use glass_do instead of separate calls,' and frames itself as replacing 'screenshot poll-loops.' However, differentiation from the other wait siblings (glass_wait_for_log, glass_wait_for_region, glass_wait_stable) is only implicit via 'accessible element' and 'not pixels or visual stability,' not stated as explicit exclusions.

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

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