Skip to main content
Glama

batch

Destructive

Runs an ordered list of tool calls in one shot to collapse many round-trips, halting on the first failed precondition or step error and returning a per-step trace for re-planning.

Instructions

Run an ORDERED LIST of tool calls in one shot (collapses many round-trips into one). Each step is { name, arguments, expect? } (args is accepted for arguments). name+arguments is a normal tool call (compound like {"name":"computer","arguments":{"action":"type","text":"hi"}} or a granular tool). Optional expect is a precondition checked by RE-PERCEIVING before the step runs: {"window":"notepad"} (foreground window must match) or {"element":"Send"} (a11y element must be present). The batch HALTS on the first failed precondition, refusal, or step error and returns a per-step trace so you re-plan from real state. A step is refused exactly as a direct call would be (the user has stopped or paused clawdcursor, a dangerous key combo, an AI assistant window in front). Do not batch past an irreversible step the user did not ask for: ask first with system pause_for_user.

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": "batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsYesOrdered steps to run. Each step is a normal tool call: { "name": "<tool>", "arguments": {...}, "expect"?: {"window"?,"element"?} } ("args" is accepted for "arguments"). (A JSON-encoded string of the same array is also accepted.)
maxStepsNoMost steps one batch may hold; a longer one is refused before step 1 (default 12).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.3.0
    • changedInput schema / properties / maxSteps / description
      Previous value: -"Hard cap on executed steps (default 12)."New value: +"Most steps one batch may hold; a longer one is refused before step 1 (default 12)."
  2. Changed2 schema fields changedv2.0.0
    • removedInput schema / properties / allowConfirm
      Removed value: -{
      -  "description": "Request that confirm-tier steps proceed. Only effective if the operator enabled CLAWD_BATCH_ALLOW_CONFIRM=1 on the daemon; otherwise ignored and the batch halts at the confirm step. Never bypasses block-tier.",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / dryRun
      Removed value: -{
      -  "description": "Only report each step's safety tier; do not execute.",
      -  "type": "boolean"
      -}
  3. First observedv1.5.16

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, idempotentHint=false, and readOnlyHint=false, so the risk profile is carried structurally; the description does not contradict that and usefully adds that each step is refused exactly as a direct call would be and that a refused step halts the batch. It also discloses the maxSteps default of 12 in the schema and the per-step trace return. What it does not cover is the return-trace shape or partial-state consequences of a mid-batch halt, which matters for a destructive non-idempotent tool, so it lands above baseline but short of fully earning a top score.

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?

Dense but front-loaded: the ordered-list premise and step shape come first, then preconditions, then halt semantics, then the safety caveat. Slight waste in restating the `args` alias and the {name, arguments, expect} shape a second time in the schema description and in the step object, but nothing is filler.

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 2-parameter meta-tool with no output schema, the description covers step shape, precondition semantics, halt-and-trace behavior, refusal conditions, step cap, and the irreversible-action caveat — everything an agent needs to invoke it correctly and safely. The per-step trace is described at the level needed to re-plan.

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 baseline is 3; the description adds real meaning by explaining that `expect` is re-checked by RE-PERCEIVING before the step runs and that `arguments` may carry an `expect` assertion array verified after the step. It also documents the `args` alias and that a JSON-encoded string is accepted, which is behavior the schema does not spell out. The one gap is that it never explains maxSteps interaction or what a malformed step looks like.

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 an ORDERED LIST of tool calls in one shot' — and immediately frames it against the sibling tools as a batcher over 'a normal tool call (compound like computer ... or a granular tool)'. An agent can tell exactly what this does and what it does not do 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?

Gives explicit when-to-use ('collapses many round-trips into one'), explicit when-not guidance ('Do not batch past an irreversible step the user did not ask for'), and names the alternative to use instead ('ask first with system pause_for_user'). It also states the failure policy (halts on first failed precondition, refusal, or step error) so the agent knows the cost of a bad ordering.

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

Deploy Server

Other Tools