edit_file
Edit files using replace, diff, line numbers, or character match methods. Select the appropriate editing approach for your task.
Instructions
Edit a file using various methods (replace, diff, line numbers, character matching)
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": {
"path": "<path>",
"method": "<method>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the file to edit | |
| method | Yes | Editing method to use | |
| target | No | Target text to find/replace (for replace and character-match methods) | |
| replacement | No | Replacement text | |
| startLine | No | Start line number (1-based, for line-numbers method) | |
| endLine | No | End line number (1-based, for line-numbers method) | |
| startChar | No | Start character position (0-based, for character-match method) | |
| endChar | No | End character position (0-based, for character-match method) | |
| diffContent | No | Diff content in unified format (for diff method) | |
| diffFormat | No | Diff format (default: unified) | unified |