Skip to main content
Glama

Robot Actions — Remote Device Control

Flow recording replace step

flow_recording_replace_step
DestructiveIdempotent

Replace one step of an in-progress recording (before flow_recording_save) with a freshly-captured action, without changing its position. Performs the action live on the device — same as flow_recording_action — then overwrites the step at stepIndex instead of appending. Use this to fix a mis-recorded step (wrong element bound, wrong action) in place rather than deleting + re-recording + reordering. Replacing the appLaunch step (index 1) is rejected. Accepts the same action params as flow_recording_action.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoX coordinate (tap/doubleTap/longPress/swipe start; assert & scrollToElement target element)
yNoY coordinate (tap/doubleTap/longPress/swipe start; assert & scrollToElement target element)
toXNoSwipe end X
toYNoSwipe end Y
textNoText to type (sendKeys)
appIdNoApp to launch for an appLaunch step: Android package name, iOS bundle id. Required when action=appLaunch.
actionYesAction type
waitMsNoWait duration ms (for wait action)
keyCodeNoAndroid keycode (keyPress, e.g. 3=HOME, 4=BACK)
keyNameNoHardware button name for pressButton (e.g. 'home', 'volumeUp', 'volumeDown', 'lock'). Required when action=pressButton.
expectedNoExpected value (required for textEquals and textContains assertions).
optionalNoMark this step as one whose target is EXPECTED to be absent sometimes — a cookie banner, a first-run tutorial, an occasional interstitial. When the element cannot be found at replay the step is SKIPPED instead of failing, and no gesture is dispatched at the recorded position. Leave it off for anything whose absence is a bug: a step that is NOT optional now FAILS the replay when its element is missing, which is what tells a real regression apart from a banner that simply did not appear this run.
attributeNoAttribute to read for text assertions. iOS: label, value, name. Android: text, content-desc, resource-id. Defaults to the platform primary text attribute when omitted.
stepIndexYes1-based index of the step to replace
assertTypeNoAssertion type (required when action=assert). exists/notExists check element presence; textEquals/textContains compare an attribute value; visualMatch compares the whole screen against the screenshot captured now (takes no x/y and no expected).
durationMsNoSwipe/longPress duration ms (default 300)
appActivityNoOptional Android activity to launch with appId. Ignored on iOS.
recordingIdYesRecording ID from flow_recording_start
visionFallbackNoLet a vision model settle this assertion when the accessibility tree cannot find the element. Off by default, and only honoured for assertType 'exists' and 'notExists'. Turn it on for UI the tree cannot describe — canvas/WebGL screens, game engines, image-only controls with their text baked into the bitmap — where 'a person can see it' is the only check available. Leave it off for ordinary native UI: an assertion's value is that it reports what is really there, and a model asked to find something tends to find it. Ignored for text assertions, which compare exact strings that OCR cannot supply reliably.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • changedInput schema / properties / action / description
      Previous value: -"Action type to record in place of the existing step"New value: +"Action type"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "tap",
      -  "doubleTap",
      -  "longPress",
      -  "swipe",
      -  "sendKeys",
      -  "keyPress",
      -  "wait",
      -  "assert",
      -  "pressButton"
      -]New value: +[
      +  "tap",
      +  "doubleTap",
      +  "longPress",
      +  "swipe",
      +  "sendKeys",
      +  "keyPress",
      +  "wait",
      +  "assert",
      +  "pressButton",
      +  "scrollToElement",
      +  "appLaunch"
      +]
    • addedInput schema / properties / appActivity
      Added value: +{
      +  "description": "Optional Android activity to launch with appId. Ignored on iOS.",
      +  "type": "string"
      +}
    • addedInput schema / properties / appId
      Added value: +{
      +  "description": "App to launch for an appLaunch step: Android package name, iOS bundle id. Required when action=appLaunch.",
      +  "type": "string"
      +}
    • changedInput schema / properties / assertType / description
      Previous value: -"Assertion type (required when action=assert)."New value: +"Assertion type (required when action=assert). exists/notExists check element presence; textEquals/textContains compare an attribute value; visualMatch compares the whole screen against the screenshot captured now (takes no x/y and no expected)."
    • changedInput schema / properties / assertType / enum
      Previous value: -[
      -  "exists",
      -  "notExists",
      -  "textEquals",
      -  "textContains"
      -]New value: +[
      +  "exists",
      +  "notExists",
      +  "textEquals",
      +  "textContains",
      +  "visualMatch"
      +]
    • changedInput schema / properties / attribute / description
      Previous value: -"Attribute to read for text assertions. iOS: label, value, name. Android: text, content-desc, resource-id."New value: +"Attribute to read for text assertions. iOS: label, value, name. Android: text, content-desc, resource-id. Defaults to the platform primary text attribute when omitted."
    • changedInput schema / properties / keyName / description
      Previous value: -"Hardware button name for pressButton. Required when action=pressButton."New value: +"Hardware button name for pressButton (e.g. 'home', 'volumeUp', 'volumeDown', 'lock'). Required when action=pressButton."
    • addedInput schema / properties / optional
      Added value: +{
      +  "description": "Mark this step as one whose target is EXPECTED to be absent sometimes — a cookie banner, a first-run tutorial, an occasional interstitial. When the element cannot be found at replay the step is SKIPPED instead of failing, and no gesture is dispatched at the recorded position. Leave it off for anything whose absence is a bug: a step that is NOT optional now FAILS the replay when its element is missing, which is what tells a real regression apart from a banner that simply did not appear this run.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / visionFallback
      Added value: +{
      +  "description": "Let a vision model settle this assertion when the accessibility tree cannot find the element. Off by default, and only honoured for assertType 'exists' and 'notExists'. Turn it on for UI the tree cannot describe — canvas/WebGL screens, game engines, image-only controls with their text baked into the bitmap — where 'a person can see it' is the only check available. Leave it off for ordinary native UI: an assertion's value is that it reports what is really there, and a model asked to find something tends to find it. Ignored for text assertions, which compare exact strings that OCR cannot supply reliably.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / x / description
      Previous value: -"X coordinate (tap/doubleTap/longPress/swipe start; assert target element)"New value: +"X coordinate (tap/doubleTap/longPress/swipe start; assert & scrollToElement target element)"
    • changedInput schema / properties / y / description
      Previous value: -"Y coordinate (tap/doubleTap/longPress/swipe start; assert target element)"New value: +"Y coordinate (tap/doubleTap/longPress/swipe start; assert & scrollToElement target element)"
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare destructive=true / idempotent=true, but the description adds real behavioral context: the action is performed LIVE on the device as a side effect, the step at stepIndex is overwritten rather than appended, and the index-1 appLaunch case is rejected. The one tension is that it advertises a live device side effect while idempotentHint=true claims repeat calls add no effect — not a direct contradiction (the recording state is idempotent) but worth noting.

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

Conciseness5/5

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

Four front-loaded sentences, each carrying distinct information: what it does, how it differs mechanically, when to use it vs. the alternative, and the one validation constraint. No restatement of the name or schema.

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 19-param mutation tool with full annotation coverage and no output schema, the description supplies everything an agent needs: purpose, lifecycle placement, in-place overwrite semantics, the cross-reference to the action-param set, and the rejection rule. Return values are not required given no output schema.

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 schema already documents all 19 params (baseline 3). The description adds meaning beyond the schema by cross-referencing 'Accepts the same action params as flow_recording_action' and by stating the validation rule tying stepIndex/action together (index 1 appLaunch rejected).

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?

States a specific verb+resource+scope: 'Replace one step of an in-progress recording ... with a freshly-captured action, without changing its position.' It also names the lifecycle boundary (before flow_recording_save) and the mechanism (overwrites the step at stepIndex instead of appending), which lets an agent distinguish it from flow_recording_action and flow_recording_delete_step without opening a 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?

Explicitly states when to use it ('fix a mis-recorded step ... in place') and names the alternative workflow it replaces ('rather than deleting + re-recording + reordering'). It also gives a hard when-not constraint: 'Replacing the appLaunch step (index 1) is rejected.'

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources