Skip to main content
Glama

edit_file_multi

Destructive

Apply multiple ordered file edits atomically and roll back all changes if any edit fails; supports optional replace-all matching.

Instructions

Apply several edits atomically. Each edit is {"old_string": ..., "new_string": ..., optional "replace_all": "true"}. Edits apply in order; if any fails nothing is written.

Input Schema

NameRequiredDescriptionDefault
pathYes
editsYes
dry_runNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=false. The description adds useful behavioral context beyond those annotations: edits apply in order, and if any edit fails, nothing is written. It does not explain dry_run, but the transaction behavior is clearly disclosed.

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 three focused sentences, front-loading the atomic multi-edit purpose before detailing the edit object and failure behavior. Every sentence adds necessary information with no wasted wording.

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?

An output schema exists, so return values need not be described, and annotations cover the safety profile. However, for a destructive file mutation tool with three parameters and 0% schema coverage, the description should explain dry_run and when to prefer this over sibling edit tools.

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 0%, so the description carries the burden of explaining parameters. It does a good job explaining the edits array structure, including old_string, new_string, and optional replace_all, but it does not explain path or dry_run, leaving two parameters undocumented.

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?

The description clearly states a specific action and resource: applying several edits atomically to a file. It implies a multi-edit tool, but it does not explicitly distinguish this from sibling tools like edit_file or replace_lines, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The atomic all-or-nothing behavior implies this tool should be used when multiple related edits must succeed together. However, it never says when to choose this over edit_file or replace_lines, nor does it state exclusions or prerequisites.

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