edit_code
Replace exact code snippets to modify functions or blocks, avoiding full-file overwrites.
Instructions
QUICK EDIT: Replace a specific code snippet with a new one. AI should use this tool to modify functions or code blocks without overwriting the entire file.
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": {
"filePath": "<filePath>",
"oldCode": "<oldCode>",
"newCode": "<newCode>"
},
"name": "edit_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newCode | Yes | New code to replace with | |
| oldCode | Yes | Old code to replace (must match exactly) | |
| filePath | Yes | File path | |
| allow_external_access | No | Set to true to allow modifying files outside the project root. User must explicitly approve this action. |