Skip to main content
Glama

Ui Wait For Element

ui_wait_for_element
Read-only

Deterministic synchronization — replaces all sleeps. Polls for an element until it reaches state (present|enabled|focused|absent) or times out. A timeout is an EXPLICIT error, never a false success. Returns {satisfied, waited_ms, element_ref?, bounds?, role?, label?, enabled_unknown?}. state:'enabled' is satisfied unless the app publishes AXEnabled=false; if the app publishes no AXEnabled at all the result carries enabled_unknown:true — the wait did not block, but nothing was actually verified about enabled-ness.

Input Schema

NameRequiredDescriptionDefault
roleNoAccessibility role of the element (e.g. AXButton, AXTextField).
labelNoVisible label or title of the element.
matchNoHow to compare label: "exact" (default) or "contains".
stateNoDefault present.
poll_msNoDefault 150.
window_idNoWindow to look in, from list_windows. Narrows the search to one window.
timeout_msNoDefault 5000.
app_bundle_idNoBundle id of the app to look in (e.g. com.apple.Safari). Narrows the search and makes it faster.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / app_bundle_id / description
      Added value: +"Bundle id of the app to look in (e.g. com.apple.Safari). Narrows the search and makes it faster."
    • addedInput schema / properties / label / description
      Added value: +"Visible label or title of the element."
    • addedInput schema / properties / match / description
      Added value: +"How to compare label: \"exact\" (default) or \"contains\"."
    • addedInput schema / properties / role / description
      Added value: +"Accessibility role of the element (e.g. AXButton, AXTextField)."
    • addedInput schema / properties / window_id / description
      Added value: +"Window to look in, from list_windows. Narrows the search to one window."
  2. Changed5 schema fields changed
    • removedInput schema / properties / app_bundle_id / description
      Removed value: -"Bundle id of the app to look in (e.g. com.apple.Safari). Narrows the search and makes it faster."
    • removedInput schema / properties / label / description
      Removed value: -"Visible label or title of the element."
    • removedInput schema / properties / match / description
      Removed value: -"How to compare label: \"exact\" (default) or \"contains\"."
    • removedInput schema / properties / role / description
      Removed value: -"Accessibility role of the element (e.g. AXButton, AXTextField)."
    • removedInput schema / properties / window_id / description
      Removed value: -"Window to look in, from list_windows. Narrows the search to one window."
  3. Changed5 schema fields changed
    • addedInput schema / properties / app_bundle_id / description
      Added value: +"Bundle id of the app to look in (e.g. com.apple.Safari). Narrows the search and makes it faster."
    • addedInput schema / properties / label / description
      Added value: +"Visible label or title of the element."
    • addedInput schema / properties / match / description
      Added value: +"How to compare label: \"exact\" (default) or \"contains\"."
    • addedInput schema / properties / role / description
      Added value: +"Accessibility role of the element (e.g. AXButton, AXTextField)."
    • addedInput schema / properties / window_id / description
      Added value: +"Window to look in, from list_windows. Narrows the search to one window."
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: a timeout is an explicit error rather than a false success, the full return shape is enumerated, and the enabled-state semantics are disclosed including the enabled_unknown edge case where nothing was actually verified. Annotations only cover the read-only safety profile; the description carries the real operational nuances.

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?

Front-loaded with the core purpose and directive, then progressively adds return shape and edge-case semantics. Dense but every sentence earns its place; the final enabled/AXEnabled sentence is long but justified by a non-obvious behavior.

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?

No output schema exists, so the description appropriately documents the return object and the enabled_unknown flag. Combined with 100% schema coverage and read-only annotations, an agent has everything needed to call and interpret the tool correctly.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning for the state parameter — explaining what 'enabled' means and the AXEnabled fallback behavior — that the schema does not convey. Other parameters (poll_ms, timeout_ms, match) rely entirely on the schema.

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?

States a specific verb and resource: polls an element until it reaches a named state or times out. Distinguishes itself from siblings like ui_find_element and ui_get_element by framing itself as synchronization ('replaces all sleeps') rather than a one-shot lookup.

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?

'Deterministic synchronization — replaces all sleeps' gives a clear directive on when to reach for this tool instead of a fixed delay. It does not explicitly name the alternative tools (ui_find_element/ui_get_element) or state when-not to use it, so it stops short of full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources