add_script_function
Append a function to a GDScript file by providing the script path, function name, parameters, body, and optional return type. Enables programmatic script modification in Godot Engine projects.
Instructions
Append a function to GDScript.
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>",
"func_name": "<func_name>"
},
"name": "add_script_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Function body | pass |
| path | Yes | Path to .gd script file | |
| params | No | Parameter names (e.g. ["delta: float"]) | |
| func_name | Yes | Function name | |
| after_func | No | Insert after this function | |
| return_type | No | Return type hint |