Edit several places in a file
files_editManyChange SEVERAL places in ONE file in a single call. Use this instead of calling files.edit again and again on the same file: each files.edit is another round trip that re-sends the whole conversation. The edits apply in order, all of them or none: if one snippet is missing or ambiguous the file is left untouched and the error names the edit that failed, so you fix that one and send the list again.
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": {
"id": "<id>",
"path": "<path>",
"edits": "<edits>"
},
"name": "files_editMany"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| path | Yes | REQUIRED. The one file every edit applies to, volume-root relative, e.g. '/index.js'. | |
| edits | Yes | Applied in order to the same file. Two edits must not touch the same text: once an edit has replaced a snippet, a later edit can no longer match it. |