Skip to main content
Glama

godot_get_project_structure

Analyze Godot project folder hierarchies to visualize file organization and directory structure for development workflows.

Instructions

Return a nested folder/file view of a Godot project or one of its subfolders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYesPath to the Godot project directory or its project.godot file.
folder_pathNoOptional absolute, relative, or res:// path for the subfolder to inspect. Defaults to the project root.
max_depthNoMaximum folder depth to expand below the chosen root.
include_hiddenNoWhether to include hidden files and folders such as `.godot` or `.godot-mcp`.

Implementation Reference

  • The handler method `get_project_structure` inside `GodotController` which executes the logic to retrieve the project structure.
    def get_project_structure(
        self,
        project_path: str,
        folder_path: str | None = None,
        max_depth: int = 6,
        include_hidden: bool = False,
    ) -> dict[str, Any]:
        project_dir = ensure_project_path(project_path)
        if max_depth < 0:
            raise GodotError("`max_depth` must be 0 or greater.")
    
        root_dir, root_resource_path = resolve_project_directory_path(project_dir, folder_path)
        entries, directory_count, file_count = _collect_project_entries(
            project_dir=project_dir,
            current_dir=root_dir,
            max_depth=max_depth,
            include_hidden=include_hidden,
        )
    
        return {
            "project_path": str(project_dir),
            "root_path": str(root_dir),
            "root_resource_path": root_resource_path,
            "max_depth": max_depth,
            "include_hidden": include_hidden,
            "directory_count": directory_count,
            "file_count": file_count,
            "entries": entries,
            "tree_text": _render_project_tree(root_resource_path, entries),
        }
  • The tool definition and handler registration for "godot_get_project_structure" in the GodotMcpServer class.
    ToolDefinition(
        name="godot_get_project_structure",
        description="Return a nested folder/file view of a Godot project or one of its subfolders.",
        input_schema={
            "type": "object",
            "properties": {
                "project_path": {
                    "type": "string",
                    "description": "Path to the Godot project directory or its project.godot file.",
                },
                "folder_path": {
                    "type": "string",
                    "description": "Optional absolute, relative, or res:// path for the subfolder to inspect. Defaults to the project root.",
                },
                "max_depth": {
                    "type": "integer",
                    "description": "Maximum folder depth to expand below the chosen root.",
                    "default": 6,
                    "minimum": 0,
                },
                "include_hidden": {
                    "type": "boolean",
                    "description": "Whether to include hidden files and folders such as `.godot` or `.godot-mcp`.",
                    "default": False,
                },
            },
            "required": ["project_path"],
            "additionalProperties": False,
        },
        handler=lambda args: self.controller.get_project_structure(
            project_path=args["project_path"],
            folder_path=args.get("folder_path"),
            max_depth=int(args.get("max_depth", 6)),
            include_hidden=bool(args.get("include_hidden", False)),
        ),
    ),
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions returning a 'nested folder/file view,' which implies a read-only operation, but does not specify output format, potential errors, performance considerations, or system interactions. This leaves gaps for a tool that interacts with file systems.

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, clear sentence that efficiently conveys the tool's purpose without unnecessary details. It is front-loaded and wastes no words, making it easy to understand at a glance.

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?

Given the complexity of file system interaction and lack of annotations and output schema, the description is insufficient. It does not explain the return format (e.g., JSON structure), error handling, or limitations like file size or permissions, which are critical for a tool that navigates project directories.

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 parameters. The description adds no additional parameter semantics beyond implying a hierarchical output structure. Baseline score of 3 is appropriate as the schema handles parameter documentation adequately.

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 tool's purpose: 'Return a nested folder/file view of a Godot project or one of its subfolders.' It specifies the verb ('return'), resource ('folder/file view'), and scope ('Godot project or subfolders'), but does not explicitly differentiate it from sibling tools like 'godot_list_resources' or 'godot_get_scene_tree', which might also provide structural information.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools or contexts where this tool is preferred, such as for file system exploration versus resource listing or scene tree inspection. Usage is implied by the purpose but not explicitly stated.

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