Skip to main content
Glama

edit_transaction

Coordinates atomic multi-file code edits using begin, edit, commit, and rollback/undo actions; use it for transactional changes while single-file edits need no transaction.

Instructions

Multi-file edit with rollback/undo (begin->edit->commit); single-file edits don't need one.

Input Schema

NameRequiredDescriptionDefault
seqNoChunk seq.
fileNoPath (edit).
nameNoTxn name (begin).
editsNoArray of {old_string,new_string} | {line_span,new_lines}; line_span {start_line,end_line,expect_sha}, end_line null=EOF.
filesNoBroadcast to all.
linesNoChunk lines.
totalNoChunk count.
actionYesAction.
atomicNoDefault true.
createNoNew file (needs content).
txn_idNoTxn id.
contentNoFile content (create).
dry_runNoedit/edit_multi: validate only.
expect_shaNoassemble sha256.
file_editsNoedit_multi: [{file, edits}] (same edit objects).
workspace_dirYesProject root (abs).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed22 schema fields changedv0.5.28
    • changedInput schema / properties / action / description
      Previous value: -"Transaction action to perform."New value: +"Action."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "begin",
      -  "edit",
      -  "edit_multi",
      -  "commit",
      -  "undo_commit",
      -  "rollback",
      -  "info"
      -]New value: +[
      +  "begin",
      +  "edit",
      +  "edit_multi",
      +  "edit_chunk",
      +  "assemble",
      +  "commit",
      +  "undo_commit",
      +  "rollback",
      +  "info"
      +]
    • changedInput schema / properties / atomic / description
      Previous value: -"For edit_multi: all-or-nothing (default: true)."New value: +"Default true."
    • addedInput schema / properties / content
      Added value: +{
      +  "description": "File content (create).",
      +  "type": "string"
      +}
    • addedInput schema / properties / create
      Added value: +{
      +  "description": "New file (needs content).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "edit/edit_multi: validate only.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / edits / description
      Previous value: -"Array of {old_string,new_string}. Required for edit."New value: +"Array of {old_string,new_string} | {line_span,new_lines}; line_span {start_line,end_line,expect_sha}, end_line null=EOF."
    • addedInput schema / properties / edits / items / properties / line_span
      Added value: +{
      +  "type": "object"
      +}
    • addedInput schema / properties / edits / items / properties / new_lines
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / properties / edits / items / properties / replace_all
      Removed value: -{
      -  "type": "boolean"
      -}
    • removedInput schema / properties / edits / items / required
      Removed value: -[
      -  "old_string"
      -]
    • addedInput schema / properties / expect_sha
      Added value: +{
      +  "description": "assemble sha256.",
      +  "type": "string"
      +}
    • changedInput schema / properties / file / description
      Previous value: -"Single file path relative to workspace_dir (required for action=edit)."New value: +"Path (edit)."
    • changedInput schema / properties / file_edits / description
      Previous value: -"Per-file edits for edit_multi: [{file, edits}]. Overrides files+edits."New value: +"edit_multi: [{file, edits}] (same edit objects)."
    • removedInput schema / properties / file_edits / items
      Removed value: -{
      -  "properties": {
      -    "edits": {
      -      "description": "Array of edits for this file",
      -      "items": {
      -        "properties": {
      -          "new_string": {
      -            "type": "string"
      -          },
      -          "old_string": {
      -            "type": "string"
      -          },
      -          "replace_all": {
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "old_string"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "file": {
      -      "description": "File path relative to workspace_dir",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "file",
      -    "edits"
      -  ],
      -  "type": "object"
      -}
    • changedInput schema / properties / files / description
      Previous value: -"Multiple file paths relative to workspace_dir. Same edits applied to all (broadcast mode)."New value: +"Broadcast to all."
    • addedInput schema / properties / lines
      Added value: +{
      +  "description": "Chunk lines.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / name / description
      Previous value: -"Transaction name (required for action=begin)."New value: +"Txn name (begin)."
    • addedInput schema / properties / seq
      Added value: +{
      +  "description": "Chunk seq.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / total
      Added value: +{
      +  "description": "Chunk count.",
      +  "type": "integer"
      +}
    • changedInput schema / properties / txn_id / description
      Previous value: -"Transaction ID (required for edit, edit_multi, commit, undo_commit, rollback, info)."New value: +"Txn id."
    • changedInput schema / properties / workspace_dir / description
      Previous value: -"REQUIRED: project root (abs). reindex first if new."New value: +"Project root (abs)."
  2. First observed

TDQS

A3.6/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 discloses the transactional rollback/undo model and workflow, but omits mutation risks, atomicity semantics, action-specific side effects, and error/concurrency behavior.

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?

A single sentence, front-loaded with the core capability and workflow. Every clause earns its place and there is no redundant text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a 16-parameter, 9-action mutation tool with no annotations and no output schema. One sentence does not adequately explain actions like edit_chunk, assemble, undo_commit, info, or the roles of atomic, dry_run, create, and txn_id; the schema descriptions are too terse to fill those gaps.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 16 parameters, establishing a baseline of 3. The description adds little parameter-level meaning beyond the begin->edit->commit sequence and relies on the schema's terse field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific capability: multi-file edit with rollback/undo via begin->edit->commit. It also distinguishes itself from single-file edits, though it does not name a specific sibling alternative.

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 explicit when-to-use guidance (multi-file edits needing rollback/undo) and when-not-to-use guidance (single-file edits don't need one). It does not name the preferred tool for single-file edits.

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