add_script_function
Append a new function to a GDScript file in Godot projects. Specify parameters, return type, and body to add functionality while preventing duplicates.
Instructions
Append a new function to a GDScript file. Fails if the function already exists.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Absolute path to the project directory | |
| scriptPath | Yes | Script path (res:// or relative to project) | |
| funcName | Yes | Function name (valid GDScript identifier) | |
| params | No | Parameter list string, e.g. "delta: float, speed := 5.0" (empty string for none) | |
| body | Yes | Function body (unindented — tabs will be added automatically). Use newlines between statements. | |
| returnType | No | Optional return type annotation, e.g. "void" or "bool" | |
| isStatic | No | Whether to declare the function as static (default: false) |