game_script
Attach, detach, or retrieve GDScript source for any node in Godot. Control node scripts directly to manage game logic without manual editor steps.
Instructions
Attach, detach, or get source of node scripts
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": {
"nodePath": "<nodePath>",
"action": "<action>"
},
"name": "game_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action: attach, detach, get_source | |
| source | No | GDScript source code (for attach) | |
| nodePath | Yes | Path to the node | |
| className | No | Class the script extends |