Skip to main content
Glama

wait_for

Block until text or element appears (or disappears with state 'gone') in mobile UI. Returns elapsed time and semantic diff; on timeout returns current UI tree without throwing.

Instructions

BLOCK until text or an element appears (or disappears with state:'gone') — use this instead of screenshot+sleep loops. Returns immediately when the condition is met, with elapsed time and a semantic diff of what changed. On timeout it returns matched:false plus the current UI tree (never throws) so you can see what IS on screen.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoSubstring to wait for anywhere on screen
stateNoDefault 'visible'
deviceNoDevice id from list_devices. Optional when exactly one device is booted.
selectorNo
timeoutMsNoDefault 15000, max 120000
Behavior5/5

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

No annotations are provided, yet the description fully discloses blocking behavior, immediate return on condition met, timeout handling (returns matched:false with UI tree), and never throwing exceptions.

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 packed with information, front-loaded with the primary purpose, no redundant words.

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

Completeness5/5

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

Despite no output schema, the description thoroughly explains return values and timeout behavior, covering all necessary context for a responsive tool.

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 high (80%), and the description adds meaning by stating that text is a substring, state defaults to 'visible', and device is optional. The selector object details are in the schema.

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?

Clearly states the tool blocks until text or element appears/disappears, distinguishing it from screenshot loops and sibling tools like wait_for_idle or screenshot.

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?

Explicitly recommends this tool over screenshot+sleep loops and describes behavior on timeout, but does not provide explicit when-not-to-use scenarios.

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/roti-c137/twiddle-mcp'

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