Skip to main content
Glama

run_flow

Executes a declarative sequence of mobile UI steps in one server-side call, auto-waiting for elements and stopping on failure to return the failing step and UI tree.

Instructions

Run a declarative flow of UI steps server-side in a single call, using a subset of Maestro's YAML syntax. Steps auto-wait for their elements (no manual sleeps); execution stops at the first failure and returns the failing step plus the current UI tree so the caller can take over from there. Commands: launchApp, tapOn, doubleTapOn, longPressOn, inputText, eraseText, assertVisible, assertNotVisible, extendedWaitUntil, scrollUntilVisible, swipe, back, pressKey, hideKeyboard, waitForAnimationToEnd, stopApp, clearState, openLink, runFlow (inline commands or file: for composing flow files, with when: visible/notVisible/platform — use it to handle known popups), repeat (times and/or while: visible/notVisible). Selectors: text/id/type match as case-insensitive substrings, index picks the Nth match (0-based), optional: true skips instead of failing. Flows support ${VAR} placeholders resolved from the env parameter (or header env defaults). A Maestro-style header (appId: ... env: ... --- ...) is supported in YAML flows; runFlow file: paths resolve relative to the referencing flow file.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "run_flow"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoVariables for ${VAR} placeholders in the flow, e.g. {"ROUTE_ID": "123"}. Overrides header env defaults.
stepsNoFlow as a JSON array of step objects, e.g. [{"tapOn": {"id": "fab"}}, {"assertVisible": "Done"}]
app_idNoDefault appId for launchApp/stopApp/clearState steps (overrides the YAML header)
dry_runNoIf true, only parse and list the steps — no device needed
observeNoCapture screen state after a successful run. Default: none
platformNoTarget platform. Inferred if omitted.
device_idNoDevice ID. Omit for the connected device.
flow_fileNoAbsolute path to a .yaml flow file (same syntax as flow_yaml)
flow_yamlNoFlow in Maestro-subset YAML (steps list, optional appId header)
default_timeout_msNoAuto-wait budget per element lookup. Default: 10000
dismiss_dev_overlaysNoClear React Native LogBox overlays before running. They intercept taps aimed at the app underneath, and a release build has none, so this is a no-op there. Kept out of the YAML so flows stay portable to Maestro. Default: true

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

A4.3/5.0
Behavior4/5

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

Adds substantial behavior beyond the readOnlyHint=false/destructiveHint=false annotations: auto-wait per element, fail-fast with the failing step and current UI tree returned, ${VAR} resolution order, and header/path resolution semantics. It stops short of describing the success-path return payload, which matters for a tool with no output schema.

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?

Purpose and key guarantees are front-loaded, then commands, selectors, and variable handling in a logical progression. It is dense and semicolon-heavy but almost every clause carries operational information; the command list could be tightened.

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 an 11-parameter orchestration tool with no output schema, it covers execution semantics, failure behavior, variable resolution, and the step DSL. The remaining gap is what a successful run returns (only hinted by the observe parameter), which is the main thing an agent still needs to infer.

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?

The description does real work for the untyped 'steps' array by enumerating supported commands, selector matching rules (case-insensitive substring, 0-based index, optional:true), repeat variants, and ${VAR}/env resolution. Other parameters such as device_id, platform, and flow_file vs flow_yaml precedence are left to the already-complete schema.

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?

Opens with a specific verb + resource + scope: run a declarative multi-step UI flow server-side in one call using Maestro-subset syntax. This immediately differentiates it from single-action siblings like tap, swipe, and type_text without needing to open either schema.

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?

Gives clear context for use: batch multi-step automation in one call, take over manually after a failure, and use inline runFlow with when: visible/notVisible to handle known popups. It does not explicitly say when to prefer individual step tools or when not to use flows, so there are no stated exclusions.

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