Skip to main content
Glama
grandMA2 MCP
by drohi-r

run_command_batch

Run multiple raw MA commands sequentially over one held connection, with destructive-command risk checks and confirmation, stopping at the first console error.

Instructions

Run many raw MA commands in order on one held connection (DESTRUCTIVE if any line is).

Every line (and every ';'-part of a line) is risk-classified before anything
is sent; if any is DESTRUCTIVE the whole batch needs confirm_destructive=True.
Each command waits for its own console prompt, so batches run far faster than
one send_raw_command call per line. Stops at the first console error or
pop-up unless stop_on_error=False (a pop-up always stops the batch).

Args:
    commands: Command lines to send, in order.
    commands_file: Path to a .txt/.cmd/.ma2/.macro file, one command per
        line; blank lines and lines starting with '#' are skipped.
    confirm_destructive: Required when any line is DESTRUCTIVE.
    stop_on_error: Stop at the first rejected command (default True).
    delay: Seconds to wait after each send before reading (default 0).
    timeout: Seconds to wait for each command's first output.

Returns:
    str: JSON summary — total, executed, failed (line, command, errors),
        stopped_early, duration_s, last_reply.

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": "run_command_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
delayNo
timeoutNo
commandsNo
commands_fileNo
stop_on_errorNo
confirm_destructiveNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so: every line is risk-classified before sending, DESTRUCTIVE content forces confirm_destructive=True, the batch halts on the first console error or pop-up unless stop_on_error=False, and a pop-up always halts. These are exactly the safety and failure-mode facts an agent needs before calling a destructive-capable tool.

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?

Risk warning and the core differentiator are front-loaded in the first two sentences, followed by behavior, then Args/Returns. Every sentence conveys a distinct operational fact (classification gate, prompt-per-command, stop semantics) with no filler.

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?

Covers the destructive gate, error/pop-up stop rules, parameter formats, and the JSON summary fields (total, executed, failed, stopped_early, duration_s, last_reply). For a six-parameter, unannotated, destructive-capable batch tool, nothing an agent needs to call it correctly is missing.

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 description coverage is 0%, so the description must compensate, and it documents all six parameters with meaning beyond the schema: accepted file extensions for commands_file, that blank lines and '#' lines are skipped, what 'first output' means for timeout, and what delay measures. Defaults are given where behaviorally relevant.

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 raw MA commands in order on one held connection') plus the key differentiator from send_raw_command (one held connection vs. one call per line). An agent can distinguish it from the sibling send_raw_command without opening either schema.

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?

Usage context is clear: use this for many commands because batching on a held connection is 'far faster than one send_raw_command call per line.' It names the alternative and the condition that selects it, but stops short of an explicit exclusion (e.g., 'use send_raw_command instead for a single command').

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

Deploy Server

Other Tools