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
| Name | Required | Description | Default |
|---|---|---|---|
| delay | No | ||
| timeout | No | ||
| commands | No | ||
| commands_file | No | ||
| stop_on_error | No | ||
| confirm_destructive | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |