Skip to main content
Glama
xinyuzjj

Godot MCP Enhanced

by xinyuzjj

update_project_uids

Update UID references in Godot projects by resaving resources. Resolves broken references after moving or renaming files (Godot 4.4+).

Instructions

Update UID references in a Godot project by resaving resources (for Godot 4.4+)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the Godot project directory

Implementation Reference

  • Handler function that executes the 'update_project_uids' tool logic. Validates projectPath, then delegates to executeOperation which runs a Godot script with the operation name.
    private async handleUpdateProjectUids(args: any): Promise<ToolResult> {
      args = this.normalizeParameters(args);
    
      if (!args.projectPath) {
        return this.createErrorResponse('Project path is required');
      }
    
      try {
        const { stdout, stderr } = await this.executeOperation(
          'update_project_uids',
          {},
          args.projectPath
        );
    
        if (stderr && stderr.includes('ERROR')) {
          return this.createErrorResponse(`Failed to update UIDs: ${stderr}`);
        }
    
        return this.createSuccessResponse(`Project UIDs updated successfully`, stdout);
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return this.createErrorResponse(`Failed to update UIDs: ${errorMessage}`);
      }
    }
  • Tool registration with input schema definition for 'update_project_uids'. Defines the name, description, and inputSchema requiring 'projectPath' (string).
    {
      name: 'update_project_uids',
      description: 'Update UID references in a Godot project by resaving resources (for Godot 4.4+)',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'Path to the Godot project directory',
          },
        },
        required: ['projectPath'],
      },
    },
  • src/index.ts:826-828 (registration)
    Switch-case dispatch that routes the 'update_project_uids' tool call to the handler handleUpdateProjectUids.
    case 'update_project_uids':
      result = await this.handleUpdateProjectUids(request.params.arguments);
      break;
  • executeOperation helper method that runs the actual Godot script. It takes an operation name and parameters, builds a Godot command line with --headless --path --script, and executes it.
    private async executeOperation(
      operation: string,
      params: OperationParams,
      projectPath: string
    ): Promise<{ stdout: string; stderr: string }> {
      this.logDebug(`Executing operation: ${operation} in project: ${projectPath}`);
      this.logDebug(`Original operation params: ${JSON.stringify(params)}`);
    
      const snakeCaseParams = this.convertCamelToSnakeCase(params);
      this.logDebug(`Converted snake_case params: ${JSON.stringify(snakeCaseParams)}`);
    
      if (!this.godotPath) {
        await this.detectGodotPath();
        if (!this.godotPath) {
          throw new Error('Could not find a valid Godot executable path');
        }
      }
    
      try {
        const paramsJson = JSON.stringify(snakeCaseParams);
    
        const args = [
          '--headless',
          '--path',
          projectPath,
          '--script',
          this.operationsScriptPath,
          operation,
          paramsJson,
        ];
    
        if (GODOT_DEBUG_MODE) {
          args.push('--debug-godot');
        }
    
        this.logDebug(`Executing: ${this.godotPath} ${args.join(' ')}`);
    
        const { stdout, stderr } = await execFileAsync(this.godotPath!, args);
    
        return { stdout: stdout ?? '', stderr: stderr ?? '' };
      } catch (error: unknown) {
        if (error instanceof Error && 'stdout' in error && 'stderr' in error) {
          const execError = error as Error & { stdout: string; stderr: string };
          return {
            stdout: execError.stdout ?? '',
            stderr: execError.stderr ?? '',
          };
        }
    
        throw error;
Behavior2/5

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

Without annotations, the description bears full responsibility for disclosing behavior. It indicates that resources are modified (destructive operation), but provides no details on reversibility, safety, error conditions, or side effects.

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 sentence that efficiently conveys the core purpose and context. Every word contributes meaning without redundancy.

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 lack of output schema and annotations, the description is too sparse. It does not explain the effects of the operation, success conditions, or potential errors, leaving significant gaps for an agent to assess.

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?

The input schema already describes the 'projectPath' parameter fully. The description adds no extra semantic meaning beyond the schema, so the baseline score of 3 is appropriate.

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 tool updates UID references in a Godot project, specifying the method (resaving resources) and version target (Godot 4.4+). It distinctively sets itself apart from sibling tools which focus on different project operations.

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 minimal usage context (version requirement) but lacks explicit guidance on when to use this tool versus alternatives, when not to use it, or any prerequisites.

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