replace_symbol
Update a function, class, or interface by providing only its new implementation. Avoids reading the entire file first, saving context and token usage.
Instructions
Replace the full body of a named function, class, or interface. The AI sends only the new implementation — no need to read the full file first.
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": "<file>",
"symbol": "<symbol>",
"new_body": "<new_body>"
},
"name": "replace_symbol"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Relative file path | |
| symbol | Yes | Exact name of the function, class, or interface to replace | |
| new_body | Yes | Complete new implementation (including the function signature line) |