Skip to main content
Glama

Wait for something to appear or disappear

ui_wait_for
Read-only

Poll an app's windows until a specified UI element appears or disappears, so you can wait for long jobs like analysis, generation, transcription, or export to finish before continuing.

Instructions

Poll an app's windows until an element with the given text/role appears (or disappears, with gone: true). Use after starting long jobs like analysis, generation, transcription or export.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "app": "<app>"
    },
    "name": "ui_wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
appYesApp to control: finalcut, motion, logic, mainstage, compressor, pixelmator, keynote, pages, numbers, or any other app name, bundle ID or .app path
goneNo
roleNoAccessibility role without the AX prefix, e.g. Button, TextField, CheckBox, PopUpButton, MenuButton, Slider, Row, StaticText
textNoText in the element's title, description or value (case-insensitive)
exactNoRequire the whole text to match
indexNoWhich match to use when several match (0 = first)
withinNoOnly search inside this element id from ui_snapshot
timeoutSecondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds useful polling semantics and the appear/disappear duality. However, it omits the key behavioral facts for a wait primitive: what happens on timeout (error vs. empty result), polling cadence, and whether it returns the matched element. Those gaps keep it at a 3.

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?

Two sentences, no filler, with the core behavior front-loaded and the usage trigger second. Every clause earns its place, including the compact 'gone: true' hint.

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

Completeness3/5

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

With 8 parameters, no output schema, and a long default timeout of 120s, the description should explain the outcome on timeout and what a successful wait yields. It covers the what and when but not the result contract, so an agent cannot fully predict the return value or failure mode.

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 75%, so the schema documents most parameters including text, role, exact, index, within and timeoutSeconds. The description only adds meaning for 'gone' and implies how text/role combine as match criteria. It says nothing about 'within', 'index', or 'exact' beyond the schema, so it does not compensate for the remaining coverage gap.

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

Purpose4/5

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

The description states a specific verb and resource: polling an app's windows until a matching element appears or disappears. The parenthetical '(or disappears, with gone: true)' makes the dual mode explicit. It does not explicitly contrast with ui_find, which is the nearest sibling doing a one-shot lookup, so it stops short of a 5.

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?

It gives concrete when-to-use guidance: 'Use after starting long jobs like analysis, generation, transcription or export.' That is a clear contextual trigger. It does not say when not to use it (e.g., use ui_find when the element should already be present) or mention how it relates to ui_snapshot/ui_find, so alternatives are left implicit.

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