Skip to main content
Glama

multi_edit

Destructive

Apply multiple exact-text replacements to one remote file in order, all or none. Use it to update several spots in a single call instead of editing each occurrence separately.

Instructions

Apply several exact-text replacements to one remote file in order; all or none are applied. On a guarded fleet you must first ask the user and get their explicit agreement; only then set confirm to the fleet name.

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
pathYesFile path on the remote machine: absolute, or relative to the workspace directory.
editsYesReplacements applied in order, all or none.
fleetNoFleet name. Omit to use the default.
confirmNoGuarded fleets only: the fleet name, set only after the user explicitly agreed. Never set it on your own.
contextNoContext name. Omit to use the default.
workspaceNoWorkspace id. Omit to use this session's workspace on the fleet.

Output Schema

NameRequiredDescriptionDefault
kindYes
mimeNo
noteNo
pathNo
sizeNo
countNo
linesNo
whereYes
sha256No
contentNo
entriesNo
new_fileNo
warningsNo
truncatedNo
workspaceYes
next_offsetNo
total_linesNo
omitted_bytesNo
written_bytesNo

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?

Annotations already declare destructiveHint=true, idempotentHint=false, and openWorldHint=true, so the risk profile is partly covered. The description adds real behavior beyond that: ordered application and all-or-nothing atomicity, plus a human-consent gate for guarded fleets. It leaves unstated what happens on a failed match and how the result is reported.

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?

Two sentences, zero waste: the atomic ordered-replacement purpose is front-loaded, then the guarded-fleet consent constraint. Every clause carries information an agent needs.

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?

With an output schema present and full schema coverage, the description needn't explain returns; it correctly focuses on atomicity and the consent gate for a destructive, non-idempotent write tool. A sentence on failure semantics (e.g., an unmatched old_string aborts the whole batch) would make it complete.

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 explains `path`, `confirm`, `fleet`, `context`, and `workspace`. The description reinforces the `confirm` consent workflow and the ordering of `edits`, but largely restates what the schema fields already say; baseline 3 applies.

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?

"Apply several exact-text replacements to one remote file in order" names a specific verb (apply), resource (one remote file), and quantity (several), which implicitly distinguishes it from the single-edit sibling `edit`. It stops short of naming the sibling outright, so differentiation is inferable rather than explicit.

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 gives one clear conditional rule: on a guarded fleet, ask the user first and only then set `confirm` to the fleet name. That is genuine when-to guidance, but there is no guidance on choosing multi_edit over `edit`, `write_file`, or `bash`-based editing, and no exclusions.

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