Skip to main content
Glama

Run sequence

run_sequence

Run multiple Android interaction steps in one call without agent round-trips, enabling scripted or timer-driven flows with conditional guards, optional steps, and per-step results.

Instructions

Run several interaction steps in ONE call — no agent round-trip between them. Use for scripted flows and, crucially, flows driven by NATIVE TIMERS (background-token clear, a biometric prompt that auto-fires on resume) where a round-trip per step would perturb the timing you're testing: e.g. key:home → sleep:19 → launch → sleep:9 → tap_text:Cancel (if_present:biometric) → assert_foreground(package) → describe_ui. Each step has an 'action' (sleep, tap, tap_text, tap_element, key, text, swipe, launch, stop, assert_foreground, wait_text, describe_ui) with its params; an if_present/if_absent guard skips a step unless a selector is (not) on screen — that's how you express a conditional cancel; and optional=true lets a step fail without aborting. Returns a per-step result (ok/skipped/error) with elapsed_ms plus the final hierarchy. A non-optional step error stops the rest.

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": {
      "steps": "<steps>"
    },
    "name": "run_sequence"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsYesOrdered steps to run in one call. Each has an 'action' (sleep, tap, tap_text, tap_element, key, text, swipe, launch, stop, assert_foreground, wait_text, describe_ui) plus that action's params, and optional if_present/if_absent guards and an 'optional' flag. Results include elapsed_ms.
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
capture_finalNoAppend the settled UI hierarchy after the last step (unless the run aborted) so you see the end state in this same response. Default true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.0
    • changedInput schema / properties / steps / items / properties / seconds / description
      Previous value: -"sleep: how long to pause, in seconds (fractions ok)."New value: +"sleep: how long to pause, in seconds (fractions ok; capped at 300, like the wait tool)."
  2. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only supply title, openWorldHint=false and destructiveHint=false, so the description carries the real burden and does: it discloses the return shape (per-step ok/skipped/error with elapsed_ms plus the final hierarchy), abort semantics ('a non-optional step error stops the rest'), guard skipping, and the 300s sleep cap. The only unstated trait is that executed steps are not rolled back, a minor gap against otherwise rich disclosure.

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?

Front-loaded with the core value proposition and dense with usable detail, but the full action list is enumerated in the description and then again in the steps schema description, which is redundant. The single long paragraph also packs guards, example flow and return shape together, making it harder to scan than it needs to be.

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?

With no output schema, the description still tells the agent what comes back (per-step status, elapsed_ms, final hierarchy) and how failure propagates. For a nested step-runner of this complexity, nothing an agent needs in order to invoke it correctly is missing.

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 baseline is 3, but the description adds conceptual meaning the schema cannot: it explains that if_present/if_absent combine with a step to express a conditional cancel, and that optional lets a step fail without aborting. Those are cross-parameter semantics rather than restatements of field text.

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?

The opening clause states a specific verb and resource — 'Run several interaction steps in ONE call' — and immediately names the capability it replaces (per-step agent round-trips). An agent can tell this apart from the sibling primitives tap, swipe, tap_on_text and wait without opening any 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?

It gives explicit selection criteria: use for scripted flows and especially for flows driven by native timers, with the reason spelled out ('a round-trip per step would perturb the timing you're testing'). A concrete end-to-end example sequence is supplied, which is stronger than a generic when-to-use sentence.

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