Edit Files
editApply exact literal text replacements across one or more files, with dry-run mode to preview changes before saving.
Instructions
Apply sequential literal string replacements to one or more files (max 5 files per call). Modes: single-file { path, edits } or per-file { files: [{ path, edits }] }. oldText must match file content exactly; include 3-5 lines of surrounding context to ensure uniqueness. Set dryRun=true to preview diffs without writing. For glob-based bulk regex replacement across many files, use replace_text instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Single file path; mutually exclusive with files | |
| edits | No | Replacements applied to path; not allowed when using files | |
| files | No | Per-file entries (batch mode) | |
| dryRun | No | Preview diffs without writing to disk (default: false = apply edits) | |
| ignoreWhitespace | No | Ignore leading/trailing whitespace differences when matching oldText |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| results | Yes | Per-path edit results ordered to match the input paths | |
| summary | Yes |