get_godot_version
Retrieve the installed Godot engine version to verify compatibility and ensure proper project setup.
Instructions
Get the installed Godot version
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_godot_version"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1227-1263 (handler)The handler function that detects the Godot executable path if needed, executes it with the --version flag using execAsync, trims the stdout, and returns it as text content. Handles errors by providing 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:720-727 (schema)The schema definition for the get_godot_version tool, including name, description, and empty input schema (no parameters required). This is returned in the ListTools response.
name: 'get_godot_version', description: 'Get the installed Godot version', inputSchema: { type: 'object', properties: {}, required: [], }, }, - src/index.ts:942-943 (registration)The switch case registration that maps the 'get_godot_version' tool call to the handleGetGodotVersion handler method in the CallToolRequestSchema request handler.
case 'get_godot_version': return await this.handleGetGodotVersion();