Skip to main content
Glama

run_batch

Execute multiple file and command operations as one dependency-aware batch. Independent steps run in parallel, dependencies enforce order, failures halt by default, and per-step results are returned.

Instructions

批次组合:一次调用描述多个文件或命令操作(exec/edit/read/put/get),按依赖边(after)拓扑执行——步骤 layer 可覆盖批次 layer;after 可跨层引用步骤 id。无依赖步骤并行,顺序链靠 after 显式保序;默认任一步失败即停(未启动步骤标 skipped)。返回逐步骤状态与证据(退出码/输出/编辑明细)。不做自动回滚(配置恢复≠运行状态回滚——重载可能已产生外部副作用),失败现场交回调用方决策。

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": {
      "steps": "<steps>"
    },
    "name": "run_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
layerNo批次默认目标层名(缺省=调用时的默认层)
stepsYes步骤数组(id 唯一)
outputNoMCP 输出模式。text 适合只读文本块的客户端,保留简短预览;full(默认)另在 structuredContent 保留完整输出
max_parallelNo并行度上限(缺省 3)
stop_on_failNo失败即停(缺省 true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well. It discloses topological execution, step-layer override, cross-layer after references, parallel execution for independent steps, default fail-stop behavior with unstarted steps marked skipped, per-step status and evidence, and explicitly warns that there is no automatic rollback because reloads may cause external side effects.

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?

The description is dense but well front-loaded, moving from what the tool does to execution semantics, failure behavior, return values, and the critical no-rollback warning. Every sentence contributes actionable information.

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 complex batch execution tool with no output schema and no annotations, it covers the essential dimensions: composition model, dependency ordering, layer override, parallelism, fail-stop semantics, return shape, and rollback limitations. Nothing critical for correct invocation is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents parameters well. The description adds meaningful semantics beyond the schema for key concepts: after defines dependency edges and can reference step ids across layers, step layer overrides batch layer, and default stop_on_fail behavior is clarified.

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?

The description states a specific verb and resource: one call composes multiple file or command operations (exec/edit/read/put/get) and executes them topologically via after dependencies. This clearly distinguishes it from single-operation siblings like run_command, edit_file, and read_file.

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?

It gives clear usage context: use it for multi-step batches, rely on after for ordering, and expect independent steps to run in parallel. It does not explicitly compare against alternatives or state when not to use it, so it falls short of a full 5.

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