get_uid
Retrieve the unique identifier (UID) for a file in a Godot 4.4+ project by providing the project and file paths.
Instructions
Get the UID for a specific file in a Godot project (for Godot 4.4+)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to the Godot project directory | |
| filePath | Yes | Path to the file (relative to project) for which to get the UID |
Implementation Reference
- src/index.ts:1235-1260 (handler)The handleGetUid private method that executes the get_uid tool logic. It normalizes parameters, validates required fields (projectPath and filePath), and calls executeOperation with the 'get_uid' command and file_path argument.
private async handleGetUid(args: any): Promise<ToolResult> { args = this.normalizeParameters(args); if (!args.projectPath || !args.filePath) { return this.createErrorResponse('Project path and file path are required'); } try { const { stdout, stderr } = await this.executeOperation( 'get_uid', { file_path: args.filePath, }, args.projectPath ); if (stderr && stderr.includes('ERROR')) { return this.createErrorResponse(`Failed to get UID: ${stderr}`); } return this.createSuccessResponse(`UID retrieved successfully`, stdout); } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return this.createErrorResponse(`Failed to get UID: ${errorMessage}`); } } - src/index.ts:711-729 (schema)The tool definition and input schema for 'get_uid'. It requires 'projectPath' (string) and 'filePath' (string) as inputs.
// UID Management (Godot 4.4+) { name: 'get_uid', description: 'Get the UID for a specific file in a Godot project (for Godot 4.4+)', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'Path to the Godot project directory', }, filePath: { type: 'string', description: 'Path to the file (relative to project) for which to get the UID', }, }, required: ['projectPath', 'filePath'], }, }, - src/index.ts:823-825 (registration)The case statement in the tool dispatch switch that routes 'get_uid' requests to handleGetUid.
case 'get_uid': result = await this.handleGetUid(request.params.arguments); break;