Skip to main content
Glama

multi_edit

Apply ordered exact string replacements to one file, committing changes only if all replacements succeed.

Instructions

Apply ordered exact replacements to one file, committing once only if every replacement succeeds.

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": {
      "path": "<path>",
      "edits": "<edits>"
    },
    "name": "multi_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
editsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Adds real behavioral context beyond the annotations: replacements are ordered, applied exactly, and committed only on all-or-nothing success. This is the key transactional trait an agent needs. It doesn't explain failure reporting or partial-failure state, keeping it from a 5.

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?

One tightly written sentence that front-loads the action and the critical atomicity guarantee. No filler.

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

Completeness4/5

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

For a two-parameter, non-nested tool with no output schema, the description covers the essential contract (atomic ordered multi-edit). Minor gaps remain around per-edit match semantics and how failures are surfaced, but nothing blocks correct invocation.

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 coverage is 0%, so the description must carry meaning, and it does clarify ordering and exact-match semantics for the edits array and the single-file constraint for path. However, nested fields like old_string/new_string/replace_all and the 100-item cap are never explained.

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 verb and resource ('Apply ordered exact replacements to one file') with a clear atomic-commit condition, which distinguishes it from the single-edit sibling. It doesn't name 'edit' explicitly, so the differentiation is inferable rather than stated.

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 description implies this is for batched multiple replacements that should succeed together, versus a single edit, but never says 'use edit for one change' or gives prerequisites. Usage context is implied rather than explicit.

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