patch_symbol
Replace a function or class block by symbol name with automatic AST validation and rollback, preventing malformed edits in source files.
Instructions
Surgically replace a function or class block by symbol name. Automatically validates AST syntax and rolls back if invalid, guaranteeing zero malformed edits.
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": {
"file_path": "<file_path>",
"symbol_name": "<symbol_name>",
"new_code": "<new_code>"
},
"name": "patch_symbol"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new_code | Yes | The replacement source code for that symbol block. | |
| file_path | Yes | Path of the file to modify. | |
| symbol_name | Yes | Name of the function, class, or method being replaced. |