Skip to main content
Glama

Robot Actions — Remote Device Control

flow_recording_wrap_in_condition

Make a RANGE of already-recorded steps conditional: they run at replay only when a check on screen passes.

Record the steps normally FIRST, then wrap them. That is the order conditionals are actually discovered — you do not know a promo banner is intermittent until you have already recorded dismissing it. The wrapped steps are MOVED into the branch, so a step never exists twice, and the remaining steps are renumbered.

The condition is evaluated against the element at (x,y), which must be on screen NOW so its locators can be recorded — the same binding every other element-bound action uses.

Use it for anything that appears only sometimes: a cookie banner, a first-run tutorial, an occasional interstitial, a rating prompt.

NOTE: at replay a condition that cannot be decided is treated as FALSE (the else branch runs). Set timeoutMs to the realistic worst-case render time of the thing you are checking for — too small a budget judges a slow element absent, runs the wrong branch, and the run still reports success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX of the element the CONDITION checks — not the element the wrapped steps act on.
yYesY of the element the condition checks.
checkYesWhat to check. exists/notExists test presence; textEquals/textContains compare an attribute. visualMatch is deliberately unavailable here — it is fail-safe by design, so as a branch selector it would silently always take the same branch.
branchNoWhich branch the wrapped steps become. Default 'then' — run them when the check passes.
expectedNoExpected value. Required for textEquals and textContains.
attributeNoAttribute to read for text checks. iOS: label, value, name. Android: text, content-desc, resource-id.
timeoutMsNoHow long to wait for the check to become true before deciding it is false. Default 5000.
recordingIdYesRecording ID from flow_recording_start
toStepIndexYesLast step to wrap (1-based, inclusive).
fromStepIndexYesFirst step to wrap (1-based). Step 1 is the appLaunch that seeds the start state and cannot be wrapped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description fully carries the behavioral burden, and it does so thoroughly. It discloses that wrapped steps are moved into the branch, never duplicated, and remaining steps are renumbered; that an undecided condition is treated as false at replay; and that a too-small timeout can silently run the wrong branch while reporting success.

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?

The description is long but dense and front-loaded: scope, ordering constraint, locator binding, use cases, and failure semantics each get focused treatment. Every paragraph adds information an agent needs, and there is no filler or repetition of schema content.

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?

Given the tool's complexity, 10 parameters, and no annotations or output schema, the description covers the essential behavioral context: recording order, state changes to the step list, branch semantics, the on-screen locator requirement, and timeout consequences. The schema handles parameter syntax, so nothing critical is missing for an agent to invoke the tool correctly.

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 description coverage is 100%, so the baseline is 3. The description adds meaningful semantics beyond the schema by explaining that x/y refer to the element the condition checks and must be on screen now, and that timeoutMs should be set to the realistic worst-case render time. It does not need to restate every parameter because the schema already documents them.

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 opening sentence conveys a specific action: making a range of already-recorded steps conditional on a screen check at replay. It clearly identifies the resource (recorded steps) and the behavior (wrap in condition), and it is easily distinguished from the many other flow_recording_* siblings.

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?

The description gives explicit when-to-use guidance: record first, then wrap; use for intermittent UI elements such as cookie banners, tutorials, and interstitials. It also states the on-screen requirement for the condition element. It does not name an alternative tool for when-not conditions, but the context is strong enough to guide an agent.

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