Skip to main content
Glama

run_sequence

Execute a scripted series of Android interaction steps in a single call, bypassing agent round-trips. Conditionally skip steps based on on-screen selectors to handle native timers and biometric prompts, with non-aborting optional steps.

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.

Input Schema

TableJSON 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.
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses sequential execution, stop-on-error behavior for non-optional steps, per-step results (ok/skipped/error) with elapsed_ms, final hierarchy capture, and the default for capture_final. It does not mention concurrency or limitations, but for a sequence runner this is adequate.

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?

The description is a single paragraph but is front-loaded with the key purpose. It covers the core functionality, guards, optionality, and return format without redundancy. It could be slightly better structured (e.g., bulleted action list), but every sentence earns its place and there is no fluff.

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?

Given no output schema, the description fills the gap by detailing return structure (per-step result, final hierarchy). All 3 parameters are explained adequately beyond the schema. Error behavior, guard semantics, and the default for capture_final are covered. The description is complete for an agent to use the tool effectively without additional context.

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?

All three parameters are already documented in the schema (100% coverage), so baseline is 3. The description adds significant value by explaining guards (if_present/if_absent), the optional flag, how results are structured, and the action type list with context. This additional guidance raises the score above baseline.

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 description opens with 'Run several interaction steps in ONE call — no agent round-trip between them,' making the core purpose immediately clear. It then distinguishes itself from sibling tools (single-step actions like tap, wait) by emphasizing the batch execution and timing-critical use cases, with a concrete example.

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?

The description explicitly states when to use: 'for scripted flows and, crucially, flows driven by NATIVE TIMERS... where a round-trip per step would perturb the timing.' It also explains how conditional guards (if_present/if_absent) and optional flags work, providing clear guidance on handling conditional branches and step failures. The implication that for non-timing-critical single steps one would use sibling tools is clear.

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/iksnerd/adb-mcp'

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