replace_symbol_body
Replace function or symbol bodies in GDScript files with hash verification to prevent stale edits during Godot development.
Instructions
Replace the entire body of a function or symbol in a GDScript file. Hash-verified to prevent stale 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": "<file>",
"symbol": "<symbol>",
"newBody": "<newBody>"
},
"name": "replace_symbol_body"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path to the .gd file | |
| symbol | Yes | Name of the symbol to replace | |
| newBody | Yes | New source code for the symbol | |
| expectedHash | No | Expected content hash of the file. If provided, edit is rejected on mismatch. |