Change a scene
godot_scene_editEdit a .tscn scene file without opening the Godot editor, changing only the lines of that edit. Add, remove, set, connect, or attach scripts, preview the diff first, then write safely.
Instructions
Change a .tscn safely without the editor, touching only the lines of that change. op and its fields: add_node (parent, name, and type or instance), remove_node (node; with its children, connections and the resources only it used), set (node, property, value; checked against Godot 4.7, enums by name, resources as res:// files), connect and disconnect (from, signal, to, method; checks the signal exists, warns when the method is missing or takes the wrong number of arguments, with the func line to add), attach_script (node, script; refuses a script that extends another node type), set_editable (node, editable). A change inside an instance that is not editable is refused, because Godot drops it on the next editor save; make_editable adds [editable] with it. Node paths are relative to the scene root ".". Without write it returns the diff and warnings; with write: true it writes and reports the review errors before and after (an error result when there are more after). A missing field or a refused change is an error and writes nothing. For project.godot use godot_project_edit; to rename a node everywhere, godot_rename.
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": {
"scene": "<scene>",
"op": "<op>"
},
"name": "godot_scene_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | what to change | |
| to | No | connect/disconnect: path of the node that receives | |
| from | No | connect/disconnect: path of the node that emits | |
| name | No | add_node: name of the new node | |
| node | No | remove_node/set/attach_script/set_editable: path of the node ("." is the root) | |
| type | No | add_node: a Godot node class, e.g. Sprite2D | |
| scene | Yes | the scene: res://main.tscn, or a path | |
| value | No | set: the value, e.g. Vector2(10, 20), 3, true, ALWAYS, res://icon.svg, null | |
| write | No | write the change (default false: show the diff only) | |
| method | No | connect/disconnect: method name | |
| parent | No | add_node: path of the parent ("." is the root) | |
| script | No | attach_script: res:// path of the script | |
| signal | No | connect/disconnect: signal name | |
| editable | No | set_editable: false to make it not editable (default true) | |
| instance | No | add_node: a res:// scene to instance instead of a type | |
| property | No | set: property name, e.g. position | |
| make_editable | No | add_node/set/connect: also make the instance editable when the change is inside one |