Skip to main content
Glama

Run Flow (replay steps)

run_flow
Destructive

Replay a saved or inline sequence of mobile UI steps (native and WebView) in order on a target device, stopping on error to validate app flows.

Instructions

按序回放一段步骤(原生+webview 混合,搭积木)。传 steps(内联数组)或 name(已存 flow)二选一;device=默认设备。step 例:[{op:'launch_app',packageName:'..'},{op:'webview_connect',packageName:'..'},{op:'assert_route',contains:'main'},{op:'tap_text',text:'登录'}]。op 全集见 flows.ts(launch_app/terminate_app/tap/tap_text/press_button/swipe/type_keys/screenshot/wait/log + webview_connect/webview_evaluate/webview_computed_style/webview_click_text/webview_disconnect + assert_route/assert_eval)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo已存 flow 名(与 steps 二选一)
stepsNo内联步骤数组(与 name 二选一)
deviceNo默认设备 serial(各 step 未指定 device 时用)
saveAsNo同时把这组 steps 存为具名 flow
stopOnErrorNo遇错即停,默认 true

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, and the description adds useful context consistent with that: the tool executes steps in order, spans native and webview, and enumerates the full op set including terminate_app, which is the destructive operation an agent should be cautious about. It does not, however, describe failure modes, side effects, or what happens with assertions/stopOnError behavior beyond what the schema already states – for a destructive tool, some cautionary framing would add value.

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 dense block with the purpose and the key parameter constraint (steps/name 二选一) front-loaded, followed by the device rule, an illustrative example, and the op enumeration. No sentence is wasted. It loses one point for structure: the long op list is run together as one parenthetical dump, making it harder to parse than a list or shorter grouping would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a composite tool with 5 parameters, a destructive annotation, and no output schema, the description covers invocation essentials well: parameter choice, example step shape, and op set. However, it never states what the tool returns (success/failure, assertion results, collected artifacts), and it defers detailed per-op field requirements to a source file (flows.ts) rather than documenting them. With no output schema, the description carries that burden and leaves a clear gap.

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 genuine meaning beyond the schema: the steps array's items are empty objects in the schema, and the description compensates with a concrete step example ({op:'launch_app',...}, {op:'tap_text',text:'登录'}) and enumerates the complete op vocabulary. It also clarifies the mutual-exclusivity and default-device semantics. It falls short of 5 because per-op required fields are not fully specified, and it defers to flows.ts for details.

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 states a specific verb ('按序回放' – replay in sequence) and a concrete resource ('一段步骤' – a sequence of steps), and immediately characterizes the tool as a composite '搭积木' (building-blocks) operation over native+webview primitives. This clearly distinguishes it from the many atomic sibling tools (mobile_launch_app, webview_click_text, etc.) and from save_flow/list_flows, which manage flows rather than execute them.

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

Usage Guidelines3/5

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

The description gives solid internal usage guidance: steps vs. name are mutually exclusive ('传 steps(内联数组)或 name(已存 flow)二选一') and device falls back to a default. However, it never explicitly says when to choose this tool over siblings (e.g., 'for a single action use mobile_*; use this to replay multiple steps') nor references the save_flow/list_flows alternative for flow management. The usage context is implied by the composite nature, not stated.

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