Skip to main content
Glama

previewapk_wait_for

Wait for a UI element to appear or disappear, or for a human to hand control back after a takeover, instead of sleeping blind. Returns found status and wait time.

Instructions

Wait until an element is present on screen (or gone, with present=false), polling the UI. Returns {found, waited_ms} — found=false at the timeout is a result, not an error. Use after actions that load content instead of sleeping blind. With condition='driver' instead of an element: wait until the human hands the wheel back to you (after previewapk_request_human or any takeover) — the result carries the handback note (handback_note, resumed) when there is one. Driver waits default to timeout_s=300 (max 600): a human step takes human time.

Input Schema

NameRequiredDescriptionDefault
idNo
descNo
textNo
deviceNo
presentNo
conditionNo'driver' waits for the handback instead of an elementelement
timeout_sNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.1

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses polling behavior, that timeout returns found=false rather than an error, the return shape {found, waited_ms}, the extra handback_note/resumed fields in driver mode, and the differing timeout defaults (30s for element waits, 300s default / 600 max for driver waits). These are exactly the non-obvious behaviors an agent would otherwise guess wrong.

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?

Dense and front-loaded: the core wait behavior, return contract, and error semantics come before the secondary driver mode. Em-dash heavy phrasing makes a couple of sentences run on, but no sentence is filler.

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 7-parameter tool with no annotations and no output schema, the description covers return values, timeout semantics, and the human-handback flow — enough to call it safely. The remaining gap is element-selector semantics and polling cadence, which leaves the most basic invocation slightly under-specified.

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 coverage is only 14%, and the description compensates for three of seven parameters (present, condition, timeout_s) including the important driver-mode timeout override. However, the four element-selector parameters (id, desc, text, device) are never explained — the agent is told to wait for 'an element' without learning how to identify it or which selector takes precedence.

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 with two clearly delineated modes: polling the UI until an element is present (or absent with present=false), and condition='driver' waiting for a human handback. An agent can tell this apart from sibling tools like previewapk_observe or previewapk_screenshot because it is framed as an active wait rather than a snapshot.

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 says to use it 'after actions that load content instead of sleeping blind', which is a concrete usage trigger, and names the precondition for driver mode ('after previewapk_request_human or any takeover'). It does not name an explicit alternative tool for the same need or state when-not-to-use, so it stops short of a 5.

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