connect_signal
Connects a signal on a source node to a target method and persists the connection in the .tscn file, saving automatically. Use it to wire up game logic like button presses or collision events in Godot scenes.
Instructions
Connect a signal on a source node to a method on a target node and persist it in the .tscn. Use get_node_signals first to confirm the names. Saves automatically. Returns: nodePath, signal, targetNodePath, method and connected, which is read back from the saved scene (null with a leading warning if that read failed). Errors if the signal or method does not exist or the connection already exists. Errors while a runtime session is live on this project.
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>",
"scenePath": "<scenePath>",
"nodePath": "<nodePath>",
"signal": "<signal>",
"targetNodePath": "<targetNodePath>",
"method": "<method>"
},
"name": "connect_signal"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | Method name on the target node to call when the signal fires | |
| signal | Yes | Signal name on the source node (e.g. "pressed", "body_entered") | |
| nodePath | Yes | Source node path from scene root | |
| scenePath | Yes | Scene file path relative to the project | |
| projectPath | Yes | Path to the Godot project directory | |
| targetNodePath | Yes | Target node path from scene root that receives the signal |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | ||
| signal | Yes | ||
| nodePath | Yes | ||
| warnings | No | ||
| connected | Yes | Whether the saved scene holds the connection. Null when the scene could not be read back. | |
| targetNodePath | Yes |