set_script
Attach a script to a node in a Godot scene. Creates the script file automatically if it doesn't exist.
Instructions
Attach a script to a node in a scene. Creates the script file if it does not exist.
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": "set_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodePath | Yes | Path to the node (e.g., "root/Player") | |
| scenePath | Yes | Path to the scene file (relative to project) | |
| class_name | No | Optional class name for the script (for C# or GDScript classes) | |
| scriptPath | Yes | Path to the script file (relative to project, e.g., "scripts/player.gd") | |
| projectPath | Yes | Path to the Godot project directory | |
| scriptLanguage | No | Script language: "gdscript" or "csharp" (default: "gdscript") |