Skip to main content
Glama

ui_wait

Polls Android UI hierarchy until a target element appears or disappears, replacing fixed sleeps with criteria and timeout.

Instructions

Wait until an element appears (or disappears) instead of guessing with sleeps. Polls the hierarchy until the criteria match or timeout elapses.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ui_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoSubstring of text (case-insensitive)
timeoutNoSeconds to wait (default 10)
intervalNoPoll interval in seconds (default 0.5)
clickableNoOnly clickable (true) / non-clickable (false)
disappearNoWait for the element to go away instead
class_nameNoSubstring of class
resource_idNoSubstring of resource-id
content_descNoSubstring of content-desc

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden and does disclose the polling loop and that it terminates when the criteria match or `timeout` elapses. It omits the important outcomes: what happens on timeout (error vs. false return), whether it returns the matched element or just a boolean, and how multiple matching elements are resolved.

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?

Two tight sentences with the purpose front-loaded and the mechanism second; nothing is redundant. It is arguably a sentence short of what an 8-parameter wait primitive needs, but there is no filler.

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?

For a tool with 8 optional filter parameters, no annotations, and no output schema, the definition should say what a successful wait yields and what a timeout produces. Neither is covered, leaving the agent to guess the return contract of a tool whose whole point is synchronization.

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 description coverage is 100%, so every parameter including `timeout`, `interval`, `disappear`, and the substring matchers is already documented in structured form. The description only echoes the timeout and disappear concepts at a high level and adds no matching-precedence or semantics (e.g. which criteria are ANDed) beyond the schema.

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?

States a specific verb and resource ('Wait until an element appears (or disappears)') plus the mechanism ('Polls the hierarchy'), which is far more specific than the bare name. It does not differentiate itself from plausible siblings like ui_find or device_wait, so an agent must infer the split between a one-shot lookup and a polling wait.

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

Usage Guidelines3/5

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

'instead of guessing with sleeps' gives an implicit when-to-use rationale, framing this as the alternative to fixed delays. There is no explicit guidance on when to prefer ui_find over a wait, or what to do if the timeout elapses (retry, fail, dump the hierarchy), so usage is implied rather than stated.

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