Skip to main content
Glama

run_macro

Execute a predefined sequence of up to 50 tool steps in one MCP call, reducing round-trip latency for predictable multi-step workflows. Stop on first error or continue to collect all results.

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
stepsNoOrdered 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. Addedv1.9.2
  2. Removedv1.8.0
  3. Addedv1.6.0
  4. Removedv1.5.1
  5. Addedv1.5.0
  6. Removedv1.4.3
  7. Addedv1.4.2
  8. Removedv1.4.0
  9. 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"
      +}
  10. Addedv1.0.3
  11. Removedv0.15.7
  12. 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"
      +}
  13. First observedv0.6.2

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so excellently. It discloses which tools are never valid steps, that sleep is a pseudo-step, the max 50-step limit, stop_on_error behavior, that intermediate results cannot be inspected, and the token cost of screenshots. This is rich behavioral context well beyond what the schema provides.

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 every section earns its place: purpose, details, usage preference, caveats, and two concrete examples. It is well-structured with clear headers and front-loads the core purpose. The length is justified by the complexity of the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is highly complete for a complex tool: it explains step validity, execution flow, failure behavior, and examples. The only minor gap is that it doesn't explicitly describe the shape of the returned results (e.g., an array of per-step outputs), though it does note that output is only returned after all steps complete or an error occurs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds substantial meaning beyond the schema: it defines the structure of steps[] with {tool, params}, explains the special sleep pseudo-step, enumerates which tools are invalid as steps, and clarifies the include/stop_on_error parameters. This goes well beyond the baseline for high schema coverage.

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 clearly states the tool's specific purpose: 'Execute multiple tools sequentially in one MCP call.' It distinguishes itself from sibling tools by emphasizing batching and latency elimination, making it easy for an agent to understand this is a meta-orchestration tool rather than a single-action tool.

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 guidance is provided: 'Prefer: Use for predictable fixed sequences... Do not use for conditional logic — return to the LLM between branches.' It also gives concrete caveats about splitting macros when steps may fail conditionally, which tells the agent exactly when this tool is and isn't appropriate.

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