Skip to main content
Glama

batch

Destructive

Run multiple codenav tool calls in one request to cut round-trips and tokens. Calls execute in order for reads and writes, with each write previewed and undoable on its own.

Instructions

Run several codenav tool calls in ONE request (saves round-trips and tokens).

Example: batch(calls=[{"tool": "outline", "args": {"file_path": "src/a.py"}}, {"tool": "symbol_info", "args": {"name": "Cart.total"}}]). Works for reads and writes alike, e.g. two edits in different files: [{"tool": "edit", "args": {"file_path": "src/a.py", "old_string": "x = 1", "new_string": "x = 2"}}, {"tool": "edit_symbol", "args": {...}}].

Each call takes the same arguments as the tool called alone (args is that tool's parameter object) and behaves as if you had called it separately: calls run in order, so a later call sees what an earlier write changed, and every write is type-checked, previewed/applied and undoable on its own (see its own section for the edit id). The result has one numbered section per call, then a summary line.

stop_on_error: stop at the first call that fails or does not apply a write (the rest are skipped and listed). Default (null): stop when the batch contains a write, keep going when it only reads. Up to 25 calls; batch cannot be nested. A call cannot refer to an earlier call's result ("$1" is refused): make the calls independent.

Annotated as possibly destructive because a batch may contain write calls; a batch made only of read tools (outline, symbol_info, hover, ...) writes nothing.

Not atomic: calls that already ran stay applied (each has its own undo id). Line/column positions you computed before the batch may be stale after an earlier edit in it, so prefer name-based calls (symbol_info, edit_symbol, rename_symbol) after writes. A preview id is invalid once a later call changes the same file.

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": {
      "calls": "<calls>"
    },
    "name": "batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
callsYes
stop_on_errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.4

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, and the description goes well beyond them: it explains that batches are NOT atomic, that already-applied calls stay applied with individual undo ids, the exact stop_on_error default (stop when a write is present, continue for read-only), the 25-call cap, and that positional arguments can go stale after in-batch edits. It even reconciles the destructive annotation by noting a read-only batch writes nothing.

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?

The core purpose is front-loaded in the first line and the remaining paragraphs are dense with distinct, actionable facts. It is slightly long with two full inline examples and a parenthetical cross-reference to the edit id, a small amount of which could be trimmed for a two-parameter tool.

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?

For a high-complexity meta-tool with no output schema, the description covers ordering, error handling, atomicity, per-call undo, call limits, nesting prohibition, argument shape, and even the result layout (one numbered section per call plus a summary line). Nothing an agent needs in order to invoke it safely 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 coverage is 0%, so the description carries the full burden, and it does: it defines `calls` as a list of {tool, args} objects where args is the target tool's own parameter object, with two worked examples, and fully specifies `stop_on_error` including its null default and divergent read/write behavior. This adds meaning the bare array/boolean schema cannot convey.

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?

Opens with a specific verb and resource: run several codenav tool calls in a single request, and immediately distinguishes itself from its siblings by framing them as the things being batched. An agent can tell this is the fan-out/meta tool without opening any schema.

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?

Explicitly states the payoff (saves round-trips and tokens), gives concrete use cases for both reads (outline + symbol_info) and writes (two edits in different files), and contrasts batch behavior with calling tools separately ('behaves as if you had called it separately'). It also names the conditions where batching is a bad fit: calls cannot be nested, cannot reference an earlier result, and must be independent, plus a preference for name-based calls after writes.

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