Skip to main content
Glama

Wait for UI

wait_for_ui
Read-only

Wait for an Android UI element matching text, content-desc, or resource-id to appear, then retrieve its tap coordinates. Solves flaky automation by polling until the element is visible.

Instructions

Poll the UI until an element containing the given text / content-desc / resource-id appears. Returns its tap coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
matchYesSubstring to look for in text, content-desc or resource-id
serialNoDevice serial (defaults to session or the only device)
timeoutSecondsNoGive up after this long (default 15)
Behavior4/5

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

The annotation readOnlyHint=true already indicates a safe read operation. The description adds valuable behavior: it polls until the element appears and explicitly states it returns coordinates (rather than performing a tap). It does not contradict the annotation, though it could detail failure behavior on timeout, but the schema's timeoutSeconds description already hints at giving up.

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?

The description is extremely concise—one sentence that front-loads the key action ('Poll the UI') and follows with the matching criteria and return value. Every word earns its place, with no wasted repetition of the tool's name.

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 3 parameters, no output schema, and a read-only annotation, the description adequately covers the core purpose and return value. It does not explicitly describe what happens if the element never appears (timeout behavior), but the schema's timeoutSeconds description covers the 'give up' aspect, making this a minor gap rather than a major omission.

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 each parameter is documented. The main description repeats the match semantics found in the schema ('text / content-desc / resource-id') but does not add meaning beyond the schema for serial or timeoutSeconds. This aligns with the baseline for full schema coverage.

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 clearly states the tool polls the UI until a matching element appears, specifying the match criteria (text/content-desc/resource-id) and the return value (tap coordinates). This distinguishes it from sibling tools like tap_element or snapshot_ui, which perform immediate actions or capture state.

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?

The description implies usage—use when you need to wait for an element to appear—but it does not explicitly state when to use this tool over alternatives or mention any exclusions. For example, it does not say 'use this before tapping an element that may not be ready' nor reference related tools like tap or tap_element.

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

Install Server

Other Tools

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/dev-jackson/androidbuild-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server