Skip to main content
Glama

flow-add-step

Execute an MCP tool call and append it as a step in the currently recording flow, turning live device actions into a portable, replayable test scenario.

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). A recorded await-ui-element that PASSED is re-probed against the tree the RUNNER resolves await:/assert: directives against, which is NOT the tree the live call read; a wait that came back { success: false } is not probed at all, and its warning says so; when the condition does not hold there the step is still recorded and message carries a warning to read before converting — whether the conversion actually breaks depends on WHY the two disagree, since a screen that moved on between the live wait and the re-probe reads the same way. If that tree could not be read at all, the warning says so instead: the conversion is UNKNOWN, not known-bad. The probe judges the selector exactly as recorded, so write the conversion in the strict map spelling ({ visible: { text: Continue } }, copying the step's selector:) — the bare-string spelling ({ visible: Continue }) re-parses as a loose selector that resolves identifier-first and falls back to text, which is a different check. message also warns when the live wait itself came back { success: false } — that tool reports a failed wait by returning rather than throwing, so the step is recorded either way. That warning names the cause, because only one of them judges the condition: a genuine miss will stop the run at replay, while a wait whose tree source was unreadable, or one that was cancelled, observed nothing and leaves the condition UNKNOWN. Returns { message, toolResult, stepCount, recorded, savedTo } on success — message is Step added to "<name>" flow plus any warning about what was recorded (read it; a warning never means the step was skipped). If it fails an error is returned and nothing is recorded. Two calls SUCCEED while recording nothing, and omit recorded to say so: a command naming a recording tool, and one naming a flow-file directive rather than a tool. Both answer with what to do instead — usually the call to make (the tool that records that directive, or the recording tool called directly), but wait, long-press, scroll-to, snapshot and when have no recording tool, so those name no call and say what to record or add by hand in its place. Either way nothing runs at the device and the take is left untouched — read recorded, not the status, to know whether a step was appended. If a step was recorded by mistake, remove it from the .yaml after flow-finish-recording rather than during the recording: against a remote client the in-memory copy is authoritative and every write serializes it over your edit, and in host mode a mid-recording edit renumbers the steps, which costs the finish the cross-tree verdicts anchored to them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoTool arguments as a JSON string, e.g. '{"udid": "ABC", "x": 0.5, "y": 0.3}'. Omit for tools with no arguments.
nameYesName of the flow being recorded — the one passed to flow-start-recording.
commandYesMCP tool name (e.g. "gesture-tap", "screenshot", "launch-app") — a TOOL, not a flow directive. A flow-file directive name ("tap", "launch", "run", "type", "await", "assert", "pinch", "swipe", "echo", "wait", "long-press", "scroll-to", "snapshot", "when") is answered with guidance, and nothing runs or is recorded: most name the tool that records the directive, while "wait", "long-press", "scroll-to", "snapshot" and "when" have no recording tool at all and are answered with what to do instead. A recording tool (flow-add-step, flow-add-echo, flow-start-recording, flow-finish-recording) is refused the same way, each for its own reason — nesting one would erase this flow at replay, end the take, or write the step twice.
delayMsNoMilliseconds to sleep before executing this step during replay.
project_rootYesAbsolute 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.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.24.0
    • changedInput schema / properties / command / description
      Previous value: -"MCP tool name (e.g. \"gesture-tap\", \"screenshot\", \"launch-app\") — a TOOL, not a flow directive. A flow-file directive name (\"tap\", \"launch\", \"run\", \"type\", \"await\", \"assert\", \"pinch\", \"echo\", \"wait\", \"long-press\", \"scroll-to\", \"snapshot\", \"when\") is answered with guidance, and nothing runs or is recorded: most name the tool that records the directive, while \"wait\", \"long-press\", \"scroll-to\", \"snapshot\" and \"when\" have no recording tool at all and are answered with what to do instead. A recording tool (flow-add-step, flow-add-echo, flow-start-recording, flow-finish-recording) is refused the same way, each for its own reason — nesting one would erase this flow at replay, end the take, or write the step twice."New value: +"MCP tool name (e.g. \"gesture-tap\", \"screenshot\", \"launch-app\") — a TOOL, not a flow directive. A flow-file directive name (\"tap\", \"launch\", \"run\", \"type\", \"await\", \"assert\", \"pinch\", \"swipe\", \"echo\", \"wait\", \"long-press\", \"scroll-to\", \"snapshot\", \"when\") is answered with guidance, and nothing runs or is recorded: most name the tool that records the directive, while \"wait\", \"long-press\", \"scroll-to\", \"snapshot\" and \"when\" have no recording tool at all and are answered with what to do instead. A recording tool (flow-add-step, flow-add-echo, flow-start-recording, flow-finish-recording) is refused the same way, each for its own reason — nesting one would erase this flow at replay, end the take, or write the step twice."
  2. Changed1 schema field changedv0.22.1
    • changedInput schema / properties / command / description
      Previous value: -"MCP tool name (e.g. \"gesture-tap\", \"screenshot\", \"launch-app\")"New value: +"MCP tool name (e.g. \"gesture-tap\", \"screenshot\", \"launch-app\") — a TOOL, not a flow directive. A flow-file directive name (\"tap\", \"launch\", \"run\", \"type\", \"await\", \"assert\", \"pinch\", \"echo\", \"wait\", \"long-press\", \"scroll-to\", \"snapshot\", \"when\") is answered with guidance, and nothing runs or is recorded: most name the tool that records the directive, while \"wait\", \"long-press\", \"scroll-to\", \"snapshot\" and \"when\" have no recording tool at all and are answered with what to do instead. A recording tool (flow-add-step, flow-add-echo, flow-start-recording, flow-finish-recording) is refused the same way, each for its own reason — nesting one would erase this flow at replay, end the take, or write the step twice."
  3. Changed4 schema fields changedv0.20.0
    • changedInput schema / properties / command / description
      Previous value: -"MCP tool name (e.g. \"tap\", \"screenshot\", \"launch-app\")"New value: +"MCP tool name (e.g. \"gesture-tap\", \"screenshot\", \"launch-app\")"
    • addedInput schema / properties / name
      Added value: +{
      +  "description": "Name of the flow being recorded — the one passed to flow-start-recording.",
      +  "type": "string"
      +}
    • addedInput schema / properties / project_root
      Added value: +{
      +  "description": "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.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "command"
      -]New value: +[
      +  "name",
      +  "project_root",
      +  "command"
      +]
  4. First observedv0.15.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations at all, the description must fully disclose behavior, and it does: gesture-tap conversion to tap, restart-app to launch, await-ui-element re-probing against a different tree, returned fields, the two success-with-no-recording cases, and the warning semantics. It even covers mid-recording edits and remote vs host mode.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is accurate and front-loaded, but it is extremely long and dense, with nested clauses and repeated warnings. It would benefit from bullets or segmented edge-case sections; the current monolithic paragraphs make it easy to miss the core while parsing.

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 mutating recording tool with no annotations and no output schema, the description is remarkably complete: it states success return shape, error behavior, when `recorded` is omitted, what to do for directives, and how to undo a mistaken step. Nothing an agent needs to safely decide and invoke the tool is missing.

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 baseline is 3. The description goes beyond the schema by detailing command-specific recording behavior for gesture-tap, restart-app, and await-ui-element, and by explaining that `name`+`project_root` jointly identify the recording. It does not add much on args/delayMs, but those are already well documented.

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 a specific verb and resource: 'Execute a tool call and record it as a step in the flow', and it anchors the flow identity to `name` + `project_root`. This clearly distinguishes it from recording siblings like flow-start-recording and flow-add-echo.

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?

It explicitly states 'Use when recording a flow and you want to run and capture each action', and it instructs the agent to see flow-start-recording if no recording is open. It also delineates when a call is refused (directives, recording tools) and even lists directives with no recording tool.

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

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/software-mansion/argent'

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