flow-add-step
Executes a tool call and records it as a step in an active flow, capturing each action for replayable end-to-end tests.
Instructions
Execute a tool call and record it as a step in the flow named by name + project_root (the recording must already be open — see flow-start-recording). Use when recording a flow and you want to run and capture each action. A coordinate gesture-tap is recorded as a portable tap: { selector } step when the tapped element has stable text/identifier (otherwise coordinates are kept with a warning); a restart-app is recorded as a launch step (record one FIRST to make the flow a self-contained e2e flow; restart-app has no chromium support, so a chromium flow records as a fragment — add the launch: { chromium: <app path> } line to the YAML afterward, deleting the executionPrerequisite line if one was recorded: a flow that starts with a launch must not declare it).
Returns { message, toolResult, stepCount, recorded, savedTo } on success. If it fails an error is returned and nothing is recorded.
If a step was recorded by mistake, edit the .yaml to remove it — against a remote client, only after flow-finish-recording: the in-memory copy is authoritative there, and every write serializes it over your edit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Tool arguments as a JSON string, e.g. '{"udid": "ABC", "x": 0.5, "y": 0.3}'. Omit for tools with no arguments. | |
| name | Yes | Name of the flow being recorded — the one passed to flow-start-recording. | |
| command | Yes | MCP tool name (e.g. "gesture-tap", "screenshot", "launch-app") | |
| delayMs | No | Milliseconds to sleep before executing this step during replay. | |
| project_root | Yes | Absolute path to the project root of the flow being recorded — the same value passed to flow-start-recording. Together with `name` it identifies which recording this step belongs to. |