Skip to main content
Glama

wait_for_condition

Waits until a selected Android element appears or disappears, the expected app is foreground, a shell command exits, or the UI stabilizes, replacing blind sleep calls with condition-based polling.

Instructions

Wait for exists/gone/foreground/shell-exit-and-output/stable UI. Missing UI transport never counts as 'gone'. Replaces blind sleep calls.

Input Schema

NameRequiredDescriptionDefault
timeoutNo
conditionYes
poll_intervalNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does add one genuinely valuable nuance — 'Missing UI transport never counts as gone' — which prevents a false-positive pass on the 'gone' condition. It says nothing about blocking vs. non-blocking behavior, what happens on timeout, or how polling/stability sampling works.

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?

Three very short sentences, front-loaded with the capability and followed by the key caveat and the motivating alternative. No filler; the telegraphic style ('shell-exit-and-output') is dense but slightly at the cost of readability.

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

Completeness2/5

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

An output schema exists, so return values need not be explained, but with zero annotations and zero schema description coverage this tool's nested Condition/Selector structure is essentially undocumented in prose. For a wait primitive with subtle semantics (timeouts, stability sampling, transport absence), the definition does far too little.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description only glosses the condition kinds. The three top-level parameters (timeout, poll_interval, condition) and the large nested Selector object (~20 fields) get no semantic explanation — timeout units, poll cadence, and how selectors combine are all left to the agent to infer.

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?

Uses an explicit verb ('Wait for') plus an enumeration of the wait kinds (exists/gone/foreground/shell-exit-and-output/stable) that maps onto the Condition.kind enum, so the agent knows exactly what the tool does. It does not name which sibling to use for adjacent needs (get_ui_tree, find_elements, ui_snapshot), so sibling differentiation is only partial.

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?

'Replaces blind sleep calls' gives a clear when-to-use signal against a common alternative. There is no when-not guidance, no mention of prerequisites (e.g. needing a prior snapshot or selector), and no steering toward other waiting/inspection siblings.

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