Skip to main content
Glama

multiedit

Apply multiple text replacements to a single file atomically, with dry-run preview. Preserves file encoding and line endings across sequential edits.

Instructions

Applies multiple old_string -> new_string replacements to a single file in one call. Edits are applied sequentially in order; each edit sees the result of the previous one. Atomic: if any edit fails, the file is not modified at all. Encoding-aware: preserves original file encoding (UTF-8, EUC-KR, Shift-JIS, etc.). Line-ending aware: old_string matches whether the file uses CRLF or LF, and inserted newlines follow the region being edited (mixed-newline files stay intact). Accepts "path" as alias for "file_path". Use dry_run=true to preview all changes without modifying the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoAlias for file_path
editsYesOrdered list of replacements to apply sequentially
dry_runNoPreview changes without modifying the file: true or false. Default: false
file_pathNoFile to edit. Relative paths use the configured workspace or MCP client root
Behavior5/5

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

No annotations are provided, so the description carries the full burden, and it does this well. It discloses sequential application, atomic rollback on any failure, encoding preservation, CRLF/LF line-ending awareness, and alias support. These are meaningful behavioral characteristics beyond what the schema shows and are critical for correct agent use.

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?

Each sentence earns its place: core function first, then ordering, atomicity, encoding, line endings, alias, and dry-run. It is detailed but compact, and the most important operational facts are front-loaded before the alias and dry-run notes.

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 multi-edit file mutation tool with no annotations and no output schema, this description is unusually complete: it tells the agent what action, in what order, with what safety guarantees, and how to preview. Return format is not described, but the invocation-relevant behavior is covered thoroughly.

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 100%, so the baseline is 3. The description adds value by clarifying that old_string matching is encoding- and line-ending-aware, that newlines in inserted text follow the edited region, that path is an alias for file_path, and that dry_run preveview changes. This supplements the schema rather than restating it.

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?

The description states a specific action ('Applies multiple old_string -> new_string replacements to a single file'), includes the precise edit primitive, and differentiates itself from siblings like edit by emphasizing multiple replacements, sequential application, and atomicity. An agent can clearly understand what the tool does and roughly how it differs from single-edit or patch alternatives.

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?

It provides clear use-context: a single file with many ordered replacements, plus a dry_run option for previewing. It does not explicitly name sibling alternatives or state when not to use it, but the description makes the intended scenario obvious and includes an actionable preview-first workflow.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/knewstimek/agent-tool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server