add_node
Add a node to a Godot scene with automatic saving. Set position, rotation, scale, visibility, and custom properties directly.
Instructions
Add a node to a Godot scene. Saves automatically. Common spatial properties (position, position3d, rotation, scale, visible, modulate) can be set as top-level params; for any other property, pass it under properties. Vector2/Vector3/Color values auto-convert from {x,y}/{x,y,z}/{r,g,b,a}. parentNodePath defaults to the scene root. Errors if nodeType is not a registered Godot class or parentNodePath does not exist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to the Godot project directory | |
| scenePath | Yes | Scene file path relative to the project | |
| nodeType | Yes | Godot node class to instantiate (e.g. "Sprite2D", "CollisionShape2D", "Label") | |
| nodeName | Yes | Name for the new node as it appears in the scene tree | |
| parentNodePath | No | Parent node path from scene root (e.g. "root/Player"). Defaults to the root node. | |
| position | No | Vector2 position (e.g. {"x": 100, "y": 200}) | |
| position3d | No | Vector3 position for 3D nodes (e.g. {"x": 0, "y": 1, "z": 0}) | |
| rotation | No | Rotation in radians | |
| scale | No | Vector2 scale (e.g. {"x": 2, "y": 2}) | |
| visible | No | Whether the node is visible | |
| modulate | No | Color modulation (e.g. {"r": 1, "g": 0, "b": 0, "a": 1}) | |
| properties | No | Additional property values as a JSON object. Top-level params (position, rotation, etc.) take precedence over keys in this dict. |