Skip to main content
Glama

map_reduce

Applies the same edit across batches of files matching a glob pattern, running concurrent isolated jobs with verification and returning a group ID to wait on.

Instructions

The same edit over many files: one job per batch of files matching glob ({{files}} in prompt_template), at most concurrency at once, each in a worktree with verify_cmd. Returns a group id for wait().

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "glob_pattern": "<glob_pattern>",
      "prompt_template": "<prompt_template>"
    },
    "name": "map_reduce"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNo
repoNo
engineNoauto
isolationNoworktree
batch_sizeNo
verify_cmdNo
concurrencyNo
glob_patternYes
prompt_templateYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/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 disclose meaningful behavior: batching, a concurrency ceiling, per-batch worktree isolation, verify_cmd execution, and a returned group id consumed by wait(). It omits what happens on batch failure, whether the worktrees must be merged via integrate, and whether the edits are applied to the original checkout at all — significant gaps for a mutating orchestration tool.

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?

Two dense sentences, front-loaded with the purpose before the mechanics, with no filler. The parenthetical about {{files}} is well-placed, though the sentence packs several clauses together at the cost of easy scanning.

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

Completeness3/5

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

For a 9-parameter mutating orchestration tool with no annotations and no output schema, the description covers the core mechanism and the return contract (group id for wait()) but leaves failure handling, worktree lifecycle/integration, and half the parameters unaddressed. It is adequate to attempt a call, not to predict outcomes.

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 0% across 9 parameters, so the description must compensate and it only partially does: it explains glob_pattern, the {{files}} placeholder in prompt_template, concurrency, verify_cmd, and implicitly isolation. cwd, repo, engine, batch_size, and the default behaviors are left entirely undocumented in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"The same edit over many files: one job per batch of files matching glob" states the verb (edit), the resource (files matching a glob), and the fan-out mechanism (one job per batch) concretely. An agent can tell this is a map-reduce orchestration tool rather than a single-file edit, though it never names a sibling it is distinct from.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by "the same edit over many files" — the agent can infer this is for bulk homogeneous edits rather than one-off changes. There is no explicit when-not guidance (e.g., when to use it vs. start_many, or when a single-file edit is preferable) and no stated prerequisites.

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