Skip to main content
Glama

Wait for UI

wait_for_ui
Read-onlyIdempotent

Use this when a desktop action must be followed by proof of an explicit native UI state or condition instead of sleeping or polling screenshots. Presence/absence waits need a semantic target; use state=changed for a broad tree change and set a bounded timeout.

Input Schema

NameRequiredDescriptionDefault
idNoElement id returned by ui_snapshot or ui_find. Linux ids are stable per-process accessibility paths and legacy linux:<index> ids remain accepted.
appNoLimit matching to an application/process name substring when available.
pidNoLimit matching to one owning process id when available.
nameNoAccessible name/title substring.
roleNoAccessible role such as Button, Edit, textbox or AXButton.
textNoText used by text_exists or active_window.
labelNoCompact numeric label from the most recent ui_snapshot/ui_find; useful for repeated actions without repeating names or coordinates.
stateNochanged captures the first matching semantic state and waits until it differs.
deviceYesReMCP device id returned by list_devices. Required for every device operation.
poll_msNoPolling interval, 50..5000 ms.
conditionNoSemantic condition to wait for; choose the condition that directly proves the requested state transition.
timeout_msNoMaximum wait, capped at 120000 ms.
browser_domNoUse native browser document accessibility where supported.
window_titleNoLimit matching to a top-level accessibility window/frame title substring when available.
automation_idNoWindows AutomationId when available.

Output Schema

NameRequiredDescriptionDefault
dataNoWait for UI structured result for wait_for_ui. Stable fields are declared explicitly; platform-specific fields may be added. Large results may return truncated/bytes/preview instead of the full payload.
textYesConcise human-readable result of the tool call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior. The description adds behavioral context by explaining that this is a semantic wait rather than a blind sleep or screenshot poll, and that state=changed waits for a semantic state to differ. It doesn't mention timeout failure behavior, but the bounded-timeout guidance and output schema cover the main behavioral contract.

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 deliver the core purpose, the avoidance guidance, and the key condition/state/timeout rules. No filler, front-loaded with the main use case, and every clause earns its place.

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?

For a tool with 15 parameters and conditional requirements, the description plus 100% schema coverage and an output schema provide enough context for correct invocation. The description covers the high-level decision logic (when, which condition, which state, timeout), while the schema handles the mechanical param details.

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. The description adds decision-level meaning beyond the schema: choosing a semantic target for presence/absence, using state=changed for broad tree changes, and setting a bounded timeout. This helps an agent select among condition/state/timeout_ms without restating field syntax.

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 states a specific purpose: wait for proof of an explicit native UI state after a desktop action, and differentiates itself from sleeping or polling screenshots. It also identifies the tool as the semantic wait for desktop UI, distinguishing it from browser_wait and wait_for_process_output.

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

Usage Guidelines5/5

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

It explicitly says when to use the tool (after a desktop action requiring proof of a native UI state) and what not to do instead (sleeping or polling screenshots). It further guides condition selection by stating presence/absence waits need a semantic target, recommending state=changed for broad tree changes, and requiring a bounded timeout.

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