Skip to main content
Glama

update_project_uids

Update UID references in Godot projects by resaving resources, ensuring compatibility with Godot 4.4+ versions.

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

  • src/index.ts:914-926 (registration)
    Tool schema and registration in the ListToolsRequestSchema response, defining name, description, and input schema.
      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:960-961 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement.
    case 'update_project_uids':
      return await this.handleUpdateProjectUids(request.params.arguments);
  • The handler function that validates the project path, checks Godot version (>=4.4), and executes the 'resave_resources' operation via Godot script to update UIDs in the project.
    private async handleUpdateProjectUids(args: any) {
      // Normalize parameters to camelCase
      args = this.normalizeParameters(args);
      
      if (!args.projectPath) {
        return this.createErrorResponse(
          'Project path is required',
          ['Provide a valid path to a Godot project directory']
        );
      }
    
      if (!this.validatePath(args.projectPath)) {
        return this.createErrorResponse(
          'Invalid project path',
          ['Provide a valid path without ".." or other potentially unsafe characters']
        );
      }
    
      try {
        // Ensure godotPath is set
        if (!this.godotPath) {
          await this.detectGodotPath();
          if (!this.godotPath) {
            return this.createErrorResponse(
              'Could not find a valid Godot executable path',
              [
                'Ensure Godot is installed correctly',
                'Set GODOT_PATH environment variable to specify the correct path',
              ]
            );
          }
        }
    
        // Check if the project directory exists and contains a project.godot file
        const projectFile = join(args.projectPath, 'project.godot');
        if (!existsSync(projectFile)) {
          return this.createErrorResponse(
            `Not a valid Godot project: ${args.projectPath}`,
            [
              'Ensure the path points to a directory containing a project.godot file',
              'Use list_projects to find valid Godot projects',
            ]
          );
        }
    
        // Get Godot version to check if UIDs are supported
        const { stdout: versionOutput } = await execAsync(`"${this.godotPath}" --version`);
        const version = versionOutput.trim();
    
        if (!this.isGodot44OrLater(version)) {
          return this.createErrorResponse(
            `UIDs are only supported in Godot 4.4 or later. Current version: ${version}`,
            [
              'Upgrade to Godot 4.4 or later to use UIDs',
              'Use resource paths instead of UIDs for this version of Godot',
            ]
          );
        }
    
        // Prepare parameters for the operation (already in camelCase)
        const params = {
          projectPath: args.projectPath,
        };
    
        // Execute the operation
        const { stdout, stderr } = await this.executeOperation('resave_resources', params, args.projectPath);
    
        if (stderr && stderr.includes('Failed to')) {
          return this.createErrorResponse(
            `Failed to update project UIDs: ${stderr}`,
            [
              'Check if the project is valid',
              'Ensure you have write permissions to the project directory',
            ]
          );
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `Project UIDs updated successfully.\n\nOutput: ${stdout}`,
            },
          ],
        };
      } catch (error: any) {
        return this.createErrorResponse(
          `Failed to update project UIDs: ${error?.message || 'Unknown error'}`,
          [
            'Ensure Godot is installed correctly',
            'Check if the GODOT_PATH environment variable is set correctly',
            'Verify the project path is accessible',
          ]
        );
      }
    }
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. It mentions 'resaving resources' which hints at mutation, but doesn't disclose critical behavioral traits such as whether this is destructive, requires specific permissions, affects project stability, or has side effects like file modifications. The description is too vague for a mutation tool with zero annotation coverage.

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 with zero waste. It front-loads the core purpose ('Update UID references') and includes essential context ('for Godot 4.4+'), making it appropriately sized and well-structured.

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 a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral impact, return values, error handling, or how UID updates interact with the project. For a tool that modifies project files, this leaves significant gaps in understanding its effects.

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 the 'projectPath' parameter. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

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 action ('Update UID references') and the resource ('a Godot project'), specifying it works by 'resaving resources' and targets 'Godot 4.4+'. It distinguishes from siblings like 'get_uid' or 'save_scene' by focusing on UID updates rather than retrieval or general saving, though it doesn't explicitly contrast with all siblings.

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 Godot 4.4+ projects needing UID reference updates, but provides no explicit guidance on when to use this tool versus alternatives like 'save_scene' or 'run_project'. It lacks context on prerequisites, exclusions, or specific scenarios requiring UID updates.

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

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