add_signal
Declare a custom signal in a GDScript file for Godot 4 projects. Insert the signal definition with optional parameters to enable communication between nodes.
Instructions
Add a signal declaration to a GDScript file. Inserted after existing signals.
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": {
"projectPath": "<projectPath>",
"scriptPath": "<scriptPath>",
"signalName": "<signalName>"
},
"name": "add_signal"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Absolute path to the project directory | |
| scriptPath | Yes | Script path (res:// or relative to project) | |
| signalName | Yes | Signal name (valid GDScript identifier) | |
| params | No | Optional parameter list, e.g. "amount: int, source: Node" (omit for parameterless signal) |