Skip to main content
Glama

wait_for_activity

Wait until a specified Android activity becomes the foreground (resumed) activity, with configurable timeout and polling interval. Use it to synchronize test steps after launching or navigating to a screen.

Instructions

Wait until a specific activity becomes the foreground (resumed) activity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activityYesActivity name or partial match (e.g., '.MainActivity' or 'com.example/.MainActivity')
device_idNoTarget device ID. If omitted, uses the default device.
timeout_msNoMaximum time to wait in milliseconds (default: 10000)
poll_interval_msNoPolling interval in milliseconds (default: 500)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.8.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries full responsibility for behavioral disclosure. It states the core behavior (wait until foreground) but omits critical details: it does not mention that the tool blocks until the timeout, what happens on timeout (error vs return), whether it returns any value, or how it interacts with device_id. For a blocking wait operation, this is a significant transparency gap.

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 a single, clear sentence that front-loads the essential purpose. There is no wasted wording, and it is appropriately concise for a simple wait operation.

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?

Given the absence of annotations and output schema, the description is too thin. An agent needs to know whether the tool raises an exception on timeout, what it returns upon success, and whether it targets a specific device. The current description does not address these, leaving an agent uncertain about failure modes and postconditions. For a tool with 4 parameters and no other documentation, this is incomplete.

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 100% (all four parameters have descriptions in the schema), so the baseline is 3. The description adds minimal value beyond the schema: it confirms the 'activity' parameter is the target of the wait, but it does not explain semantics of timeout_ms or poll_interval_ms beyond what the schema already states. No additional guidance on partial matching or device targeting is provided.

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?

The description clearly states the action: wait until a specific activity becomes the foreground (resumed) activity. It names the resource (activity) and the condition, and it is distinct from sibling tools like wait_for_element or wait_for_text which wait for UI elements/text. However, it does not explicitly differentiate from get_current_activity which polls the current activity, so a small gap remains.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus alternatives. The description only states what it does, with no exclusions, no mention of alternative tools, and no context about prerequisites or typical scenarios. An agent would have to infer that this is for waiting on activity state changes, but no explicit direction is provided.

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