Skip to main content
Glama

run-sequence

Execute multiple predefined device interaction steps sequentially in one call, waiting for screen changes and stopping on failure. Use it for known chains like repeated scrolls or typing then Enter.

Instructions

Run several device interaction steps in one call. Use when every step is known in advance (e.g. several scrolls, or typing then enter). If a step depends on what an earlier one shows, make separate calls. Steps run in order. After a step that can change the screen, the next one waits up to 1000ms for the element tree to settle (see settle); keep an await-ui-element before a step that needs the new screen. If a step fails (an error, a tool not allowed or not supported on the target, or a wait step that returns success=false), the sequence stops there. Returns { completed, total, steps } with a result or error for each step that ran. One screenshot and element tree are captured after the last step, not per step. A {{secret:...}} in any step skips that capture, so type and submit a secret in one sequence.

Allowed tools, args (? = optional) and targets. Positions and distances are 0–1 fractions of the screen (window on Chromium), not pixels; angles in degrees, durations in ms. gesture-tap: x, y, clickCount? [ios/android/chromium] gesture-swipe: fromX, fromY, toX, toY, durationMs?, momentum? [ios/android] gesture-scroll: x, y, deltaX?, deltaY? (positive scrolls down), durationMs? [chromium] gesture-drag: fromX, fromY, toX, toY, durationMs?, momentum? [chromium] gesture-custom: events: [{ type: "Down"|"Move"|"Up", x, y, x2?, y2?, delayMs? }], interpolate?, edge? [ios/android] gesture-pinch: centerX, centerY, startDistance, endDistance, endCenterX?, endCenterY?, angle?, durationMs? [ios/android] gesture-rotate: centerX, centerY, startAngle, endAngle, radius (or radiusX + radiusY), durationMs? [ios/android] button: button: "home"|"back"|"power"|"volumeUp"|"volumeDown"|"appSwitch"|"actionButton" [ios/android] keyboard: text? or key? (one per step, e.g. key "enter"), delayMs?; text may hold {{secret:}} placeholders, resolved server-side [all; Apple TV/Android TV: text only] paste: text (only where a user would paste, e.g. an OTP) [ios sim/android emu] rotate: orientation: "Portrait"|"LandscapeLeft"|"LandscapeRight"|"PortraitUpsideDown" [ios sim/android] shake: count? [ios sim/android emu] fold: posture? "closed"|"half-open"|"open" or angle? 0–180 (later steps land on the new panel) [foldable ios sim/android emu] tv-remote: button (one, or an array run as a path), repeat? [apple tv/android tv/vega] await-ui-element: condition: "exists"|"visible"|"hidden"|"text", selector: { text?, identifier?, role? }, expectedText?, textMatch?, timeoutMs?, pollIntervalMs? [all] await-network-request: bundleId, url, plus the standalone tool's optional args. Call network-capture-start before the sequence. [ios sim/android/chromium]

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": {
      "udid": "<udid>",
      "steps": "<steps>"
    },
    "name": "run-sequence"
  }
}

Input Schema

NameRequiredDescriptionDefault
udidYesTarget device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id), shared across all steps.
stepsYesOrdered list of interaction steps to execute sequentially
settleNoWait up to 1000ms after a screen-changing step for the element tree to settle before the next step. Default true; set false on a screen that never stops changing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / settle
      Added value: +{
      +  "description": "Wait up to 1000ms after a screen-changing step for the element tree to settle before the next step. Default true; set false on a screen that never stops changing.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / steps / items / properties / delayMs / description
      Previous value: -"Wait time in ms after this step before the next (default 100)"New value: +"Wait time in ms after this step (and after the settle wait) before the next (default 100)"
    • changedInput schema / properties / steps / items / properties / tool / description
      Previous value: -"Tool name — one of: gesture-tap, gesture-swipe, gesture-scroll, gesture-drag, gesture-custom, gesture-pinch, gesture-rotate, button, keyboard, paste, rotate, shake, fold, tv-remote, await-ui-element. On a TV target (Apple TV / Android TV / Vega) use tv-remote (remote presses) and keyboard (text)."New value: +"Tool name: one of the allowed tools listed in the description."
    • changedInput schema / properties / udid / description
      Previous value: -"Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id) — shared across all steps."New value: +"Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id), shared across all steps."
  2. Changed1 schema field changedv0.26.0
    • changedInput schema / properties / steps / items / properties / tool / description
      Previous value: -"Tool name — one of: gesture-tap, gesture-swipe, gesture-scroll, gesture-drag, gesture-custom, gesture-pinch, gesture-rotate, button, keyboard, paste, rotate, shake, tv-remote, await-ui-element. On a TV target (Apple TV / Android TV / Vega) use tv-remote (remote presses) and keyboard (text)."New value: +"Tool name — one of: gesture-tap, gesture-swipe, gesture-scroll, gesture-drag, gesture-custom, gesture-pinch, gesture-rotate, button, keyboard, paste, rotate, shake, fold, tv-remote, await-ui-element. On a TV target (Apple TV / Android TV / Vega) use tv-remote (remote presses) and keyboard (text)."
  3. Changed1 schema field changedv0.22.0
    • changedInput schema / properties / steps / items / properties / tool / description
      Previous value: -"Tool name — one of: gesture-tap, gesture-swipe, gesture-scroll, gesture-drag, gesture-custom, gesture-pinch, gesture-rotate, button, keyboard, rotate, tv-remote, await-ui-element. On a TV target (Apple TV / Android TV / Vega) use tv-remote (remote presses) and keyboard (text)."New value: +"Tool name — one of: gesture-tap, gesture-swipe, gesture-scroll, gesture-drag, gesture-custom, gesture-pinch, gesture-rotate, button, keyboard, paste, rotate, shake, tv-remote, await-ui-element. On a TV target (Apple TV / Android TV / Vega) use tv-remote (remote presses) and keyboard (text)."
  4. First observedv0.15.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: ordering, the up-to-1000ms settle wait, failure semantics (error, disallowed tool, unsupported target, or success=false stops the sequence), and the returned { completed, total, steps } shape. It also discloses a non-obvious side effect — one screenshot/element tree captured only after the last step, skipped entirely when a {{secret:...}} placeholder appears.

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: purpose and usage rule come first, then behavioral contract, then the reference catalog. The catalog is long but is load-bearing documentation the schema points to rather than padding, so the length is largely earned; the only soft cost is that reference material and behavioral guidance are blended into one prose block.

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?

For a batch orchestrator with no output schema, the definition still describes the return shape, per-step results, settle/failure behavior, and the capture side effect, and it names a prerequisite for await-network-request (call network-capture-start first). Nothing an agent needs to invoke this correctly is left implicit.

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

Parameters5/5

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

Schema coverage is 100%, but the free-form `steps[].args` object would be unusable without the description's enumerated catalog of allowed `tool` values with their per-tool arguments, optionality, and platform targets, which is exactly what the schema delegates ("one of the allowed tools listed in the description"). It further adds the coordinate convention (0–1 screen fractions, not pixels) and angle/duration units that the schema never states.

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?

"Run several device interaction steps in one call" states a specific verb (run) and resource (a batch of steps), and it immediately separates itself from the single-step siblings (gesture-tap, keyboard, button) by being the batch executor. The reader knows exactly what class of operation this is without opening the 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?

Explicit when-to-use ("every step is known in advance") and when-not ("If a step depends on what an earlier one shows, make separate calls"), plus a concrete prescription to insert await-ui-element before steps that need a new screen. That is the decision rule an agent needs to choose this over chaining siblings.

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