apply_edits
Apply exact text replacements or create up to 50 files in one call, pre-checking every file before writing and optionally running a verification command.
Instructions
Edit 1-50 files in one call. Per file: "hunks" (exact oldText -> newText, applied in order; CRLF/LF and BOM preserved) or "create" (+ overwrite). Default: every file is pre-checked and nothing is written unless all pass; bestEffort=true writes the valid files. Failed hunks report the closest matching line. dryRun validates only. Optional verify command (pwsh default, windowsHide) runs afterwards; a non-zero exit is returned as structured exitCode.
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": {
"files": "<files>"
},
"name": "apply_edits"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Base directory for relative paths and for verify (default: router cwd). | |
| files | Yes | ||
| dryRun | No | Validate and report without writing (verify is skipped). | |
| verify | No | Command run after writing (non-interactive). Non-zero exit is reported as exitCode. | |
| bestEffort | No | false (default): pre-check every file and write nothing if any fails. true: write every valid file, report the failed ones. | |
| verifyShell | No | pwsh | |
| maxVerifyChars | No | Tail of the verify output kept inline (full output is spooled). | |
| verifyTimeoutSec | No |