edit_file
Replace exact text in a workspace file with optional dry-run preview and SHA-256 verification to prevent unintended edits.
Instructions
Replace exact text, optionally preview only. Existing files require expected_sha256.
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>",
"old_string": "<old_string>",
"new_string": "<new_string>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| dry_run | No | ||
| new_string | Yes | ||
| old_string | Yes | ||
| expected_sha256 | No | ||
| expected_occurrences | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||