attach_script
Attach a GDScript file to an existing node in a Godot scene, linking the script to that node for custom behavior.
Instructions
Attach a GDScript file to an existing node in a scene
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>",
"scriptPath": "<scriptPath>"
},
"name": "attach_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodePath | Yes | Path to the node (e.g., "root" or "root/Player") | |
| scenePath | Yes | Path to the scene file (relative to project) | |
| scriptPath | Yes | Path to the GDScript file (relative to project, e.g., "scripts/player.gd") | |
| projectPath | Yes | Path to the Godot project directory |