get_godot_version
Retrieve the installed Godot engine version through the Godot MCP server, enabling AI assistants to identify and verify the current engine setup for project compatibility and execution control.
Instructions
Get the installed Godot version
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1227-1263 (handler)The main handler function for the 'get_godot_version' tool. It ensures the Godot path is detected, executes 'godot --version', and returns the stdout trimmed as text content. Handles errors gracefully with helpful messages.private async handleGetGodotVersion() { 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', ] ); } } this.logDebug('Getting Godot version'); const { stdout } = await execAsync(`"${this.godotPath}" --version`); return { content: [ { type: 'text', text: stdout.trim(), }, ], }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return this.createErrorResponse( `Failed to get Godot version: ${errorMessage}`, [ 'Ensure Godot is installed correctly', 'Check if the GODOT_PATH environment variable is set correctly', ] ); } }
- src/index.ts:719-727 (schema)The tool schema definition in the list of tools provided by ListToolsRequestSchema handler. Defines the tool name, description, and empty input schema (no parameters required).{ name: 'get_godot_version', description: 'Get the installed Godot version', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/index.ts:942-943 (registration)The registration of the tool handler in the switch statement within the CallToolRequestSchema request handler. Maps the tool name to its handler method.case 'get_godot_version': return await this.handleGetGodotVersion();