Skip to main content
Glama

Run a known sequence of UI steps

ui_batch

Run many UI steps in one call from a steps list or recipe, instead of one call per click. It stops at the first failure and reports the error with a snapshot.

Instructions

Run many UI steps with one call, from a steps list or a recipe file, instead of one tool call per click. Use it when the sequence is already known; use the single ui_* tools to explore. Unbroken runs of UI steps share one process, so pop-ups stay open between steps and the app is hidden once at the end of the run. Stops at the first failure and reports that step's error with a short snapshot. Optional steps that failed are listed in the status's skipped field: check it before trusting a done run. It runs in the background by default and writes statusFile as JSON with state running, done or failed, so long jobs outlast the 60 s bridge limit: wait for that file's state to change rather than polling with this tool. UI ops: clickMenu {path}; click {id|text|role, exact, within, depth, maxNodes, waitSeconds, requireEnabled}; setValue {id|text|role, value}, which never falls back to typing; stepValue {id|text|role, to, delta}; waitFor {id|text|role, gone, enabled, timeoutSeconds}; assert {id|text|role, value}; keys {key, modifiers}; snapshot; sleep {seconds}; hide; retry {steps, onFail, times}. Other ops: open {file}, which launches hidden; waitFile {path, stableSeconds, timeoutSeconds}; moveFile {from, to}, which never overwrites; requireUnlocked; requireClosed {waitSeconds}; requireAbsent {path}, which stops if a file is already there (put it before a waitFile or moveFile whose file an earlier run may have left). Any step can have a label, and optional: true to carry on if it fails. Write ${name} in strings and pass values in vars. In a large window, give text searches a within, or they can run past the bridge limit. It can't bring an app to the front.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ui_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
appNoApp to control. Optional when the recipe names it.
varsNoValues for ${name} in the steps
stepsNoThe steps to run, instead of a recipe
dryRunNoCheck the steps and fill in vars without touching the app
recipeNoPath to a recipe: JSON with name, app, vars (defaults) and steps
backgroundNoReturn at once and keep running. False waits for the result, so use it only for jobs under 60 s.
statusFileNoWhere to write the status JSON. Default: a new file in the temp folder.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A4.4/5.0
Behavior3/5

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

Annotations only declare readOnly=false, destructive=false, openWorld=false; the description goes well past that by explaining shared-process runs, pop-ups persisting between steps, the app being hidden at the end, abort-on-first-failure with a snapshot, the skipped field for optional steps, background-by-default statusFile semantics, and the 60 s bridge limit. It also names a hard limitation ("It can't bring an app to the front"). The 5 is held back only because interrupt/cancel behavior and permissions requirements are unstated.

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?

Front-loaded: the core distinction from single-step tools lands in the first sentence, and the run-semantics follow before the op catalog. The dense semicolon-delimited op list is information-rich but would scan better as a list; no sentence is genuinely disposable.

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 backgrounded, multi-step automation tool with 7 params and no output schema, the definition supplies the abort policy, where results land (statusFile JSON with running/done/failed), how to await completion, and per-op contracts. An agent has what it needs to call it correctly and to interpret the outcome.

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?

Top-level schema coverage is 100%, but the schema types each step as a bare object with only "op" specified, so the description carries the real burden: it enumerates every op with its option keys (click, waitFor, retry, requireAbsent, etc.), explains ${name} substitution via vars, optional/label on steps, and the within caveat for large windows. Nested step fields the schema leaves open are still only partly covered.

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 and resource ("Run many UI steps with one call") and immediately scopes it against the alternative: "instead of one tool call per click." An agent can tell it apart from ui_click/ui_set_value/ui_wait_for 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?

Explicit when-to-use ("when the sequence is already known") and when-not with the named alternative ("use the single ui_* tools to explore"). It also adds operational guidance: don't poll with this tool, wait on the status file's state instead, and use requireAbsent before a waitFile/moveFile an earlier run might have compromised.

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