Skip to main content
Glama

Run commands in parallel

batch

Run multiple commands in parallel and return all results in one call, so you can gather independent information without sequential executions.

Instructions

Run multiple commands in parallel and return all results. Each command is a binary plus an args array, executed without a shell (for a pipeline use command='sh', args=['-c', '...']). Use when you need to gather independent pieces of information in a single tool call instead of multiple sequential calls.

Input Schema

NameRequiredDescriptionDefault
commandsNoRequired.

Output Schema

NameRequiredDescriptionDefault
elapsedYes
resultsYes
retainedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses that commands execute without a shell and gives the concrete workaround (command='sh', args=['-c', '...']) for pipelines. It leaves gaps on failure semantics (what happens if one command in the batch fails) and concurrency limits, which matters for a batch executor.

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?

Three sentences, zero waste, with the core behavior front-loaded before the shell caveat and the usage guidance. Every sentence earns its place.

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?

An output schema exists, so return values need no explanation, and the execution model is well covered. What's missing is partial-failure behavior and the default/max timeout implications for a 30s default batch, which an agent would want before batching long-running commands.

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

Parameters3/5

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

Schema coverage is 100% and the schema itself documents command, label, args, cwd and timeout. The description reinforces the shell semantics but largely restates the schema's command field note rather than adding new meaning. Baseline 3 applies when the schema does the heavy lifting.

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 multiple commands in parallel and return all results') and immediately scopes the tool against the sequential-call alternative. An agent can distinguish it from run/run_seq without opening the 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?

Explicitly gives the trigger condition: gather independent pieces of information in one call instead of multiple sequential calls. It implies the boundary with sequential execution tools (run_seq) but never names them, so the routing is clear rather than airtight.

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