Skip to main content
Glama

run_macro

Execute multiple desktop or browser tools sequentially in one MCP call to cut round-trip latency for predictable multi-step workflows.

Instructions

Purpose: Execute multiple tools sequentially in one MCP call — eliminates round-trip latency for predictable multi-step workflows. Details: steps[] is an array of {tool, params} objects. Not every tool is a valid step: excel, key_locker, server_status, screenshot_query, screenshot_gc and run_macro itself never are, and whether desktop_discover/desktop_act or get_windows/get_ui_elements/set_element_value are depends on this server's configuration — each pair is refused in the other one. Everything else in the tool list is a step. The tool field's own description names the exact set THIS server dispatches. Plus a special sleep pseudo-step: {tool:"sleep", params:{ms:N}} (max 10000ms per step). stop_on_error=true (default) halts on first failure. Max 50 steps. The LLM cannot inspect intermediate results during execution — all steps run to completion (or first error) before any output is returned. Prefer: Use for predictable fixed sequences (focus → sleep → type → screenshot). Do not use for conditional logic — return to the LLM between branches so it can inspect intermediate state. Caveats: If any step may fail conditionally (e.g. a dialog that may or may not appear), split the macro at that point. Each screenshot step within a macro incurs the same token cost as a standalone call. Examples: [{tool:'focus_window',params:{windowTitle:'Notepad'}},{tool:'sleep',params:{ms:300}},{tool:'keyboard',params:{action:'type',text:'Hello'}},{tool:'screenshot',params:{detail:'text',windowTitle:'Notepad'}}] [{tool:'browser_navigate',params:{url:'https://example.com'}},{tool:'wait_until',params:{condition:'element_matches',target:{by:'text',pattern:'Example Domain'}}}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepsYesOrdered list of tool calls to execute sequentially (max 50 steps).
includeNoOptional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).
stop_on_errorNoStop execution on the first error (default true). Set false to collect all results.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv2.3.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / steps / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / steps / items / properties / params / additionalProperties
      Added value: +{}
    • addedInput schema / properties / steps / items / properties / params / default
      Added value: +{}
    • addedInput schema / properties / steps / items / properties / params / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / steps / items / properties / tool / description
      Added value: +"Tool name to call. One of: desktop_state, screenshot, mouse_click, mouse_drag, click_element, focus_window, keyboard, clipboard, window_dock, scroll, terminal, browser_open, browser_eval, browser_search, browser_overview, browser_locate, browser_click, browser_navigate, browser_fill, browser_form, workspace_snapshot, workspace_launch, wait_until, notification_show, desktop_discover, desktop_act, or the special pseudo-command \"sleep\"."
    • addedInput schema / required
      Added value: +[
      +  "steps"
      +]
  2. Addedv1.9.2
  3. Removedv1.8.0
  4. Addedv1.6.0
  5. Removedv1.5.1
  6. Addedv1.5.0
  7. Removedv1.4.3
  8. Addedv1.4.2
  9. Removedv1.4.0
  10. Changed1 schema field changedv1.2.1
    • addedInput schema / properties / include
      Added value: +{
      +  "description": "Optional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  11. Addedv1.0.3
  12. Removedv0.15.7
  13. Changed5 schema fields changedv0.10.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / _stub
      Removed value: -{
      -  "description": "Stub tool — arguments ignored."
      -}
    • addedInput schema / properties / steps
      Added value: +{
      +  "description": "Ordered list of tool calls to execute sequentially (max 50 steps).",
      +  "maxItems": 50,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / stop_on_error
      Added value: +{
      +  "default": true,
      +  "description": "Stop execution on the first error (default true). Set false to collect all results.",
      +  "type": "boolean"
      +}
  14. First observedv0.6.2

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden and does so well: it discloses the max 50 steps, stop_on_error default, 10000ms sleep cap, that intermediate results cannot be inspected mid-run, the token cost of embedded screenshots, and which sibling tools are never valid steps. It does not describe the success/failure return shape (e.g. per-step error reporting), which is the main remaining gap for a tool with no output schema.

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?

Long but well-front-loaded with Purpose/Details/Prefer/Caveats/Examples labels, and the two worked examples remove ambiguity. There is minor redundancy — the config-dependent tool pairs are explained twice — and the volume exceeds what most agents need, but almost every sentence carries specific operational guidance.

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 complex batch-execution tool with no annotations and no output schema, the description covers all decision-critical constraints an agent needs: valid step set, step limits, error-handling behavior, latency/cost implications, and when to avoid it. Nothing required to invoke it correctly 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 the baseline is 3, but the description adds genuine meaning beyond the schema: the special 'sleep' pseudo-step with its max duration, the config-dependent validity of desktop_discover/desktop_act vs get_windows/get_ui_elements/set_element_value, and the note that the tool field's own description is authoritative for the dispatched set. The include parameter is left to the schema.

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 ('Execute multiple tools sequentially in one MCP call') and immediately names the benefit and its distinguishing scope versus any single sibling tool. An agent can tell this is the macro/batch aggregator, not one of the ~30 individual action tools.

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 'Prefer' section names the use case (predictable fixed sequences like focus → sleep → type → screenshot) and the explicit exclusion (do not use for conditional logic — return to the LLM between branches). It also advises splitting the macro where a step may fail conditionally, giving a concrete when-not rule.

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