Skip to main content
Glama
minami110

GDScript Code Analyzer

by minami110

get_project_root

Locate the project root directory and count indexed GDScript files to analyze code structure in Godot game engine projects.

Instructions

Get the current project root directory and count of indexed GDScript files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the get_project_root tool logic. It returns the current project root directory path and the count of indexed GDScript files if a project root has been set, otherwise returns a message indicating no project root is set.
    def _get_project_root(self) -> CallToolResult:
        """Get the current project root.
    
        Returns:
            CallToolResult with project root info
        """
        try:
            if not self.project_root:
                return CallToolResult(
                    content=[TextContent(type="text", text="No project root set")],
                    isError=False,
                )
    
            result = {
                "project_root": str(self.project_root),
                "gdscript_files_count": len(self._gdscript_files),
            }
    
            return CallToolResult(
                content=[TextContent(type="text", text=json.dumps(result, indent=2))],
                isError=False,
            )
        except Exception as e:
            return CallToolResult(
                content=[TextContent(type="text", text=f"Error getting project root: {str(e)}")],
                isError=True,
            )
  • Defines the schema for the 'get_project_root' tool, specifying its name, description, and empty input schema (no parameters required). This is part of the tools list returned by get_tools().
    Tool(
        name="get_project_root",
        description="Get the current project root directory and count of indexed GDScript files.",
        inputSchema={
            "type": "object",
            "properties": {},
            "required": [],
        },
    ),
  • Registers the tool handler in the central dispatch method handle_tool_call by routing calls to 'get_project_root' to the _get_project_root implementation.
    elif tool_name == "get_project_root":
        return self._get_project_root()
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. It discloses the tool's behavior by specifying what it returns (directory and file count), which is useful. However, it lacks details on potential errors (e.g., if no project is loaded), performance implications, or whether this is a read-only operation (implied by 'Get' but not explicit). The description adds some value but misses key behavioral traits.

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 without unnecessary words. Every part earns its place by specifying both the primary output (directory) and secondary output (file count), making it appropriately sized and structured.

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 simplicity (0 parameters, no annotations, no output schema), the description is adequate but has gaps. It explains what the tool does but does not cover return format details (e.g., structure of the directory path or count), error conditions, or dependencies. For a tool with no structured output schema, more completeness would be beneficial to guide the agent fully.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so the schema fully documents the lack of inputs. The description does not add parameter-specific information, which is unnecessary here. A baseline of 4 is appropriate for zero-parameter tools, as there is no gap to compensate for.

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 ('Get'), the target resource ('current project root directory'), and an additional output ('count of indexed GDScript files'). It distinguishes from siblings like 'set_project_root' (which modifies) and analysis/finding tools that operate on code content rather than project metadata.

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 implies usage for retrieving project root information and file counts, which suggests context for project setup or status checks. However, it does not explicitly state when to use this versus alternatives like 'set_project_root' or when not to use it (e.g., for code analysis). The context is clear but lacks explicit exclusions or named alternatives.

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/minami110/mcp-gdscript'

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