multiedit
Apply multiple old_string to new_string replacements to one file in a single call, sequentially and atomically, with dry-run preview to check changes before writing.
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). Use dry_run=true to preview all changes without modifying the file.
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": {
"edits": "<edits>"
},
"name": "multiedit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Alias for file_path | |
| edits | Yes | Ordered list of replacements to apply sequentially | |
| dry_run | No | Preview changes without modifying the file: true or false. Default: false | |
| encoding | No | Charset override, e.g. EUC-KR or CP949; overrides .editorconfig, BOM takes priority | |
| file_path | No | File to edit. Relative paths use the configured workspace or MCP client root | |
| indent_style | No | tabs or spaces-N; default auto-detect, same as edit | |
| expected_hash | No | Expected raw-file SHA-256; mismatch rejects the whole batch |