Skip to main content
Glama

code_batch

Apply edits to multiple files in one atomic all-or-nothing call, with dry-run preview by default, so changes either fully succeed or roll back safely.

Instructions

Apply edits to N files in ONE atomic call — all or nothing; single edit → code_patch. New: create:true + content + locator.file_path. dry_run default preview.

Input Schema

NameRequiredDescriptionDefault
policyNo{all_or_nothing: boolean} (default true).
safetyNoValidation gate: {profile: standard|strict|fast, block_on_validation_error: boolean}.
writesYesNon-empty; per entry: read_ref/locator + one edit payload.
dry_runNotrue = preview; false = apply.
task_idYesTask id.
read_refNoDefault base; same file only.
request_idNoIdempotency key.
workspace_dirYesProject root.
allow_unsafe_no_baseNoForce apply without prior file-level reads (default false; gate).
expected_state_revisionNoGuard.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.28

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses atomicity, that the default is a preview (dry_run), and the create-file recipe, but says nothing about failure/rollback reporting, validation-gate behavior, or the allow_unsafe_no_base gate — significant gaps for a destructive multi-file writer.

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?

Front-loads the atomic-write contract and the sibling routing in a single dense sentence; zero filler. The create-mode fragment is telegraphic but still parseable, and nothing is buried.

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 10-parameter nested mutation tool with no annotations and no output schema, the description covers atomicity, preview default, and creation, but omits conflict/guard semantics and what a failed batch returns. The rich schema compensates for most parameter gaps, but behavioral completeness for a write tool is only adequate.

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 baseline is 3, and the description adds meaning on top: it maps create:true to content + locator.file_path and clarifies dry_run's default to preview. The policy, safety, guard, and idempotency params are left to the schema, which already documents them.

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?

Specific verb+resource+scale: 'Apply edits to N files in ONE atomic call' with the explicit constraint 'all or nothing'. It also names the sibling that handles single edits (code_patch) and flags the create path, so an agent can distinguish it from code_patch and edit_transaction without opening a 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?

Gives an explicit routing rule: multi-file atomic edits here, 'single edit → code_patch', and states dry_run defaults to preview. It does not cover when to prefer edit_transaction or invoke_capability, but the primary alternative is clearly named.

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