Skip to main content
Glama
xinyuzjj

Godot MCP Enhanced

by xinyuzjj

get_project_info

Retrieve metadata from a Godot project directory, including project settings and configuration details.

Instructions

Retrieve metadata about a Godot project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the Godot project directory

Implementation Reference

  • Handler for get_project_info tool: validates projectPath, reads project.godot config, retrieves project structure, and returns path, name, structure, and config as JSON.
    private async handleGetProjectInfo(args: any): Promise<ToolResult> {
      args = this.normalizeParameters(args);
    
      if (!args.projectPath) {
        return this.createErrorResponse('Project path is required');
      }
    
      try {
        const projectFile = join(args.projectPath, 'project.godot');
        if (!existsSync(projectFile)) {
          return this.createErrorResponse(`Not a valid Godot project: ${args.projectPath}`);
        }
    
        const projectContent = readFileSync(projectFile, 'utf-8');
        const structure = await this.getProjectStructure(args.projectPath);
    
        const info = {
          path: args.projectPath,
          name: basename(args.projectPath),
          structure,
          config: projectContent.substring(0, 1000), // First 1000 chars
        };
    
        return this.createSuccessResponse('Project info:', info);
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return this.createErrorResponse(`Failed to get project info: ${errorMessage}`);
      }
    }
  • Schema definition for get_project_info tool: requires a single string parameter 'projectPath'.
    {
      name: 'get_project_info',
      description: 'Retrieve metadata about a Godot project',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'Path to the Godot project directory',
          },
        },
        required: ['projectPath'],
      },
    },
  • src/index.ts:802-803 (registration)
    Registration dispatch for 'get_project_info' tool name to its handler method.
    case 'get_project_info':
      result = await this.handleGetProjectInfo(request.params.arguments);
  • Helper that scans the project directory and categorizes subdirectories into scenes, scripts, assets, and other.
    private async getProjectStructure(projectPath: string): Promise<any> {
      try {
        const entries = readdirSync(projectPath, { withFileTypes: true });
    
        const structure: any = {
          scenes: [],
          scripts: [],
          assets: [],
          other: [],
        };
    
        for (const entry of entries) {
          if (entry.isDirectory()) {
            const dirName = entry.name.toLowerCase();
    
            if (dirName.startsWith('.')) {
              continue;
            }
    
            if (dirName === 'scenes' || dirName.includes('scene')) {
              structure.scenes.push(entry.name);
            } else if (dirName === 'scripts' || dirName.includes('script')) {
              structure.scripts.push(entry.name);
            } else if (
              dirName === 'assets' ||
              dirName === 'textures' ||
              dirName === 'models' ||
              dirName === 'sounds' ||
              dirName === 'music'
            ) {
              structure.assets.push(entry.name);
            } else {
              structure.other.push(entry.name);
            }
          }
        }
    
        return structure;
      } catch (error) {
        this.logDebug(`Error getting project structure: ${error}`);
        return { error: 'Failed to get project structure' };
      }
    }
  • Helper that formats the successful tool response, converting data to pretty-printed JSON.
    private createSuccessResponse(message: string, data?: any): ToolResult {
      const response: ToolResult = {
        content: [
          {
            type: 'text',
            text: message,
          },
        ],
      };
    
      if (data !== undefined) {
        response.content.push({
          type: 'text',
          text: typeof data === 'string' ? data : JSON.stringify(data, null, 2),
        });
      }
    
      return response;
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavior. It mentions 'metadata' but does not specify what metadata is returned, nor does it confirm the operation is read-only.

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, concise sentence with no unnecessary words, efficiently conveying the tool's purpose.

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 simple parameter set (1 required) and no output schema, the description could hint at the type of metadata returned. It is minimally complete but lacks details about output format or fields.

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 coverage is 100%, and the parameter description in the schema already explains 'Path to the Godot project directory'. The description adds no additional semantic value beyond the schema.

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 verb 'Retrieve' and the resource 'metadata about a Godot project', distinguishing it from sibling tools like add_node or create_scene that perform modifications.

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?

The description implies usage for retrieving project metadata but provides no guidance on when not to use it or alternatives among the sibling tools.

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/xinyuzjj/godot-mcp'

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