Skip to main content
Glama

commit_write

Apply staged file writes to disk atomically after reviewing the diff, with safety checks against files changed since staging. Batch multiple writes into a single approval prompt.

Instructions

Apply a staged write to disk (atomic: tmp+rename). Call only AFTER reviewing the diff with get_diff. Refuses if the file changed since it was staged — pass force=true to overwrite anyway. Only works when write_mode is 'write' — do NOT call it in 'propose' mode (it refuses and the permission prompt would just show an opaque op_id). path and summary are REQUIRED because the user's approval prompt only shows tool args — make them say exactly what is being written. Pass ops: [{op_id, path, summary}] instead to commit a batch in ONE approval — use it for map_files stage_writes output so the user sees the whole set at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opsNoBatch commit: [{op_id, path, summary}] — one approval prompt shows the whole set
pathNoREQUIRED for single-op: the file this op writes — verified against the staged op so the approval prompt can't lie about the target.
forceNoCommit even if the file changed since staging
op_idNo
summaryNoREQUIRED for single-op: one-line description of the change — the main thing the user sees when approving.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: atomicity semantics, refusal-on-file-change with a force=true escape hatch, write_mode gating, and the user-facing approval-prompt consequences of argument choice. This is behavior an agent cannot infer from the schema.

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 and front-loaded — the core action and precondition come first, then the refusal/force rule, then the mode gate, then batching. Every sentence earns its place, though the single long paragraph could break the batch guidance out more cleanly.

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 mutation tool with no annotations and no output schema, the description covers safety, preconditions, mode gating, failure behavior, and the batch path. An agent has everything needed to call it correctly without opening sibling schemas.

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 already 80%, yet the description still adds value: it explains WHY path and summary are required (they are what the approval prompt displays) and why they must be precise, and it frames ops as the batch alternative to single-op fields. Minor gap: it doesn't clarify force versus the path/op_id pairing in edge cases.

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+resource ('Apply a staged write to disk') and immediately qualifies it with the mechanism ('atomic: tmp+rename'). This clearly separates it from sibling staging/proposal tools like propose_write and stage_delete.

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 preconditions ('Call only AFTER reviewing the diff with get_diff'), an explicit exclusion ('do NOT call it in propose mode'), and routes a specific sibling workflow ('use it for map_files stage_writes output'). When, when-not, and alternatives are all covered.

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