Skip to main content
Glama

Wait for text

wait_for_text

Polls the Android UI until an element with specified text or content description appears, then returns its tappable center; use after async actions instead of blind waits.

Instructions

Poll the UI until an element with the given text/content-description appears (or times out), then return it. Use this after an async action (network load, navigation, animation) instead of a blind wait-then-screenshot — it returns as soon as the element is present, with its tappable center. Note: canvas-drawn (RN/Skia) text never enters the hierarchy, so it will time out on those — screenshot instead.

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": {
      "text": "<text>"
    },
    "name": "wait_for_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesText or content-description to wait for.
scrollNoWhen true, swipe upward through the current scroll container while polling. Useful when Android omits off-screen ScrollView content from the accessibility tree.
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
partialNoSubstring match instead of exact. Default true.
timeout_sNoHow long to wait, in seconds. Default 15.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare openWorldHint=false and destructiveHint=false; the description adds real behavior the annotations cannot: it polls, returns as soon as the element is present (not a fixed sleep), yields the element's tappable center, can time out, and silently fails on canvas/RN/Skia text because that content is absent from the accessibility hierarchy. It does not say what a timeout returns (error vs empty result) or note anything about the polling interval.

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?

Three sentences, each carrying distinct load: the mechanism and return value first, the usage trigger second, the failure caveat last. No restatement of the tool name or title, and the most decision-relevant information is front-loaded.

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?

With no output schema, the description usefully characterizes the return (the matched element plus its tappable center) and the timeout failure mode, and the canvas caveat pre-empts the most likely silent failure. Only the timeout outcome shape and the scroll/partial behavior remain uncovered, which are minor for a polling helper.

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 schema already carries per-parameter meaning; the description still adds that the match applies to text OR content-description and that it returns a tappable center, which shapes how the result is used. It says nothing about the non-obvious knobs (scroll, partial, timeout_s), so it does not fully compensate where schema phrasing is thin.

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 ('Poll the UI until an element with the given text/content-description appears') plus the terminal condition (or times out) and what is returned. It also distinguishes itself from the generic `wait`/`screenshot` approach by name ('instead of a blind wait-then-screenshot'), so an agent can pick it without opening the schema.

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?

Gives an explicit trigger ('after an async action (network load, navigation, animation)'), an explicit alternative to avoid ('blind wait-then-screenshot'), and an explicit non-use case with the correct fallback ('canvas-drawn (RN/Skia) text never enters the hierarchy ... screenshot instead'). That is when, when-not, and what-to-use-instead in three lines.

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