Skip to main content
Glama

godot_update_node_transform

Modify node positions, rotations, and scales in Godot scene files to adjust object placement and orientation during game development.

Instructions

Update the transform section of a specific node in a saved scene. Currently supports Node2D, Node3D, and Control nodes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYesPath to the Godot project directory or its project.godot file.
scene_pathYesPath to the target .tscn file. Absolute, relative, and res:// paths are supported.
node_pathNoScene-relative node path to update. Use '.' for the root node..
transformYesTransform fields to update. Vector values can be passed as objects like {x, y} or {x, y, z}.
godot_executableNoOptional explicit path to the Godot executable or .app bundle.

Implementation Reference

  • Implementation of the update_node_transform tool in GodotController.
    def update_node_transform(
        self,
        project_path: str,
        scene_path: str,
        transform: dict[str, Any],
        node_path: str = ".",
        godot_executable: str | None = None,
    ) -> dict[str, Any]:
        project_dir = ensure_project_path(project_path)
        executable, version = resolve_godot_executable(godot_executable)
        absolute_scene_path, resource_scene_path = resolve_scene_path(project_dir, scene_path)
    
        if not absolute_scene_path.exists():
            raise GodotError(f"Scene not found: {absolute_scene_path}")
        if not isinstance(transform, dict):
            raise GodotError("`transform` must be an object.")
        if not transform:
            raise GodotError("`transform` must contain at least one field to update.")
    
        normalized_node_path = normalize_scene_node_path(node_path)
        try:
            with tempfile.NamedTemporaryFile(
                mode="w",
                encoding="utf-8",
                suffix="-godot-node-transform.json",
                delete=False,
            ) as handle:
                json.dump(transform, handle, ensure_ascii=False)
                updates_path = handle.name
        except TypeError as exc:
            raise GodotError("`transform` contains a value that could not be serialized to JSON.") from exc
    
        try:
            output = _run_godot_script(
                executable=executable,
                project_dir=project_dir,
                script_name="update_node_transform.gd",
                user_args=[
                    "--scene-path",
                    resource_scene_path,
                    "--node-path",
                    normalized_node_path,
                    "--updates-path",
                    updates_path,
                ],
            )
        finally:
            Path(updates_path).unlink(missing_ok=True)
    
        parsed = _parse_script_json_output(output, "update_node_transform.gd")
    
        return {
            "project_path": str(project_dir),
            "scene_path": str(absolute_scene_path),
            "scene_resource_path": resource_scene_path,
            "node_path": parsed.get("node_path", normalized_node_path),
            "node_name": parsed.get("node_name"),
            "node_type": parsed.get("node_type"),
            "transform_kind": parsed.get("transform_kind"),
            "supported_fields": parsed.get("supported_fields", []),
            "updated_fields": parsed.get("updated_fields", []),
            "transform": parsed.get("transform", {}),
            "godot_executable": str(executable),
            "godot_version": version,
        }
  • Registration of the godot_update_node_transform tool definition in the server.
        name="godot_update_node_transform",
        description="Update the transform section of a specific node in a saved scene. Currently supports Node2D, Node3D, and Control nodes.",
        input_schema={
            "type": "object",
            "properties": {
                "project_path": {
                    "type": "string",
                    "description": "Path to the Godot project directory or its project.godot file.",
                },
                "scene_path": {
                    "type": "string",
                    "description": "Path to the target .tscn file. Absolute, relative, and res:// paths are supported.",
                },
                "node_path": {
                    "type": "string",
                    "description": "Scene-relative node path to update. Use '.' for the root node.",
                    "default": ".",
                },
                "transform": {
                    "type": "object",
                    "description": "Transform fields to update. Vector values can be passed as objects like {x, y} or {x, y, z}.",
                },
                "godot_executable": {
                    "type": "string",
                    "description": "Optional explicit path to the Godot executable or .app bundle.",
                },
            },
            "required": ["project_path", "scene_path", "transform"],
            "additionalProperties": False,
        },
        handler=lambda args: self.controller.update_node_transform(
            project_path=args["project_path"],
            scene_path=args["scene_path"],
            node_path=args.get("node_path", "."),
            transform=args["transform"],
            godot_executable=args.get("godot_executable"),
        ),
    ),
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool updates transforms in saved scenes, implying mutation, but lacks critical behavioral details: whether it overwrites or merges transform fields, if it validates node types, what happens on errors (e.g., invalid node path), or if it saves changes automatically. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with zero waste: first states purpose and scope, second clarifies supported node types. It's front-loaded and appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks behavioral transparency (e.g., error handling, save behavior), doesn't explain return values, and offers minimal usage guidance. Given the complexity of updating scene files, more context is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 5 parameters. The description adds no parameter-specific semantics beyond implying 'transform' is for updates. Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't compensate with extra context like format examples for 'transform'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update the transform section') and target ('specific node in a saved scene'), with specificity about supported node types (Node2D, Node3D, Control). It distinguishes from siblings like 'godot_get_node_transform' (read vs. write) and 'godot_edit_scene' (general vs. transform-specific), but doesn't explicitly contrast with all siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through context: it's for updating transforms in saved scenes, with sibling 'godot_get_node_transform' suggesting this is the write counterpart. However, no explicit guidance on when to use this vs. alternatives like 'godot_edit_scene' or prerequisites (e.g., scene must exist) is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MhrnMhrn/godot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server