Skip to main content
Glama

multiedit

Apply multiple text replacements to a file in one atomic call. Uses sequential edits, preserves encoding, and supports dry-run preview.

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.). Accepts "path" as alias for "file_path". Use dry_run=true to preview all changes without modifying the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNoAbsolute path to the file to edit
pathNoAlias for file_path
editsYesOrdered list of replacements to apply sequentially
dry_runNoPreview changes without modifying the file: true or false. Default: false
Behavior5/5

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

Discloses sequential application, atomicity, encoding preservation, alias acceptance, and dry-run preview. No annotations exist, so description fully covers behaviors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Six sentences, front-loaded main action. Some redundancy (encoding might be niche), but overall concise and well-structured.

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?

Covers inputs, atomicity, encoding, dry-run, and alias. No output schema needed given description's completeness for a file-edit tool.

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

Parameters5/5

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

Adds meaning beyond schema: highlights alias 'path', sequential edits, dry-run usage. Schema coverage is 100%, but description enriches understanding.

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?

Description clearly states it applies multiple replacements to a single file, distinguishing from a single-edit tool (sibling 'edit'). Verb 'applies' and resource 'file' are specific.

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?

Provides guidance on dry_run usage but no explicit comparison to alternative 'edit' for single replacements. Context is implied but not explicit.

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