Skip to main content
Glama

godot_validate_scene

Validate Godot scene files by dry-run loading to check for parsing errors before execution, ensuring scene integrity in development workflows.

Instructions

Dry-run load a saved scene resource and report whether Godot can parse it successfully, without running the scene.

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.
godot_executableNoOptional explicit path to the Godot executable or .app bundle.

Implementation Reference

  • The implementation of the `godot_validate_scene` tool handler.
    def validate_scene(
        self,
        project_path: str,
        scene_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}")
    
        captured = _run_godot_script_with_capture(
            executable=executable,
            project_dir=project_dir,
            script_name="validate_scene.gd",
            user_args=["--scene-path", resource_scene_path],
        )
        if int(captured["returncode"]) != 0:
            details = "\n".join(
                part for part in [str(captured["stdout"]).strip(), str(captured["stderr"]).strip()] if part
            ).strip()
            raise GodotError(
                f"Godot helper script `validate_scene.gd` failed.\n"
                f"Log file: {captured['log_path']}\n"
                f"{details or 'No output was returned.'}"
            )
    
        parsed = _parse_script_json_output(str(captured["stdout"]), "validate_scene.gd")
        debug_output = _classify_debug_lines(
            str(captured["stdout"]),
            str(captured["stderr"]),
            str(captured["log_output"]),
        )
        filtered_errors = _filter_scene_validation_errors(
            debug_output["errors"],
            resource_scene_path,
            keep_fallback=not bool(parsed.get("valid", False)),
        )
    
        return {
            "project_path": str(project_dir),
            "scene_path": str(absolute_scene_path),
            "scene_resource_path": resource_scene_path,
            "valid": bool(parsed.get("valid", False)),
            "message": parsed.get("message"),
            "resource_type": parsed.get("resource_type"),
            "node_count": parsed.get("node_count"),
            "root_node_name": parsed.get("root_node_name"),
            "root_node_type": parsed.get("root_node_type"),
            "connection_count": parsed.get("connection_count"),
            "errors": filtered_errors,
            "warnings": debug_output["warnings"],
            "error_count": len(filtered_errors),
            "warning_count": debug_output["warning_count"],
            "log_path": captured["log_path"],
            "godot_executable": str(executable),
            "godot_version": version,
        }
  • Tool registration for `godot_validate_scene`.
        name="godot_validate_scene",
        description="Dry-run load a saved scene resource and report whether Godot can parse it successfully, without running the scene.",
        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.",
                },
                "godot_executable": {
                    "type": "string",
                    "description": "Optional explicit path to the Godot executable or .app bundle.",
                },
            },
            "required": ["project_path", "scene_path"],
            "additionalProperties": False,
        },
        handler=lambda args: self.controller.validate_scene(
            project_path=args["project_path"],
            scene_path=args["scene_path"],
            godot_executable=args.get("godot_executable"),
        ),
    ),
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's safe, read-only nature ('dry-run... without running') and validation purpose. However, it lacks details on error handling, output format, or performance implications like timeouts, which would be helpful for a tool with no output schema.

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?

The description is a single, efficient sentence that front-loads the core purpose ('dry-run load a saved scene resource') and clearly states the outcome ('report whether Godot can parse it successfully') with no wasted words. Every part earns its place by clarifying the tool's non-executive nature.

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

Completeness3/5

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

Given the tool's moderate complexity (validation without execution), no annotations, and no output schema, the description is adequate but has gaps. It covers the purpose and behavioral intent well, but lacks details on what the 'report' includes (e.g., success/failure, error messages) or how failures are handled, which would improve completeness for a validation tool.

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 already documents all parameters thoroughly. The description doesn't add any additional meaning or context beyond what's in the schema (e.g., it doesn't explain parameter interactions or validation specifics). Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('dry-run load'), resource ('saved scene resource'), and purpose ('report whether Godot can parse it successfully') with explicit distinction from running the scene. It differentiates from siblings like godot_run_scene by emphasizing validation without execution.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('dry-run load... without running the scene'), implying it's for validation before execution. However, it doesn't explicitly mention when not to use it or name specific alternatives among the many sibling tools, such as godot_run_scene for actual execution.

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