add_node
Add a node to a Godot scene with automatic saving. Validates property types and errors on invalid values, returning a plain-text confirmation.
Instructions
Add a node to a Godot scene. Saves automatically. position, rotation, scale, visible, modulate are top-level params; anything else goes in properties. Values are checked against the property's declared type and error instead of silently storing that type's zero value. Object-typed properties take a res:// path, a {type: ClassName, ...props} dict that builds a Resource inline, or null; slash-suffixed keys like shader_parameter/ go inside that dict, not on the node. Value coercion, Packed*Array/Array[T] element rules and error details: Property Values in docs/tools.md. Returns plain-text confirmation of the new node and type. Errors and adds nothing if nodeType is not a registered class, the parent is missing, or a property name or value is invalid. Errors while a Godot runtime session is active; stop_project or detach_project clears it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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}) | |
| nodeName | Yes | Name for the new node as it appears in the scene tree | |
| nodeType | Yes | Godot node class to instantiate (e.g. "Sprite2D", "CollisionShape2D", "Label"), or a project-relative scene path (.tscn or .scn, e.g. "scenes/enemy.tscn") to instance an existing scene as a child - instanced children serialize as `instance=ExtResource(...)` on save | |
| position | No | Position: {"x": 100, "y": 200} on a 2D node, {"x": 0, "y": 1, "z": 0} on a 3D node | |
| rotation | No | Rotation in radians | |
| scenePath | Yes | Scene file path relative to the project | |
| properties | No | Additional property values as a JSON object. Top-level params (position, rotation, etc.) take precedence over keys in this dict. | |
| projectPath | Yes | Path to the Godot project directory | |
| parentNodePath | No | Parent node path from scene root (e.g. "root/Player"). Defaults to the root node. |