Skip to main content
Glama
xinyuzjj

Godot MCP Enhanced

by xinyuzjj

launch_editor

Open the Godot editor for a project by specifying its directory path.

Instructions

Launch Godot editor for a specific project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the Godot project directory

Implementation Reference

  • src/index.ts:458-475 (registration)
    Registration of the 'launch_editor' tool in the setupToolHandlers method, defining its name, description, and input schema (requires projectPath).
    private setupToolHandlers(): void {
      this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: [
          // Project Management
          {
            name: 'launch_editor',
            description: 'Launch Godot editor for a specific project',
            inputSchema: {
              type: 'object',
              properties: {
                projectPath: {
                  type: 'string',
                  description: 'Path to the Godot project directory',
                },
              },
              required: ['projectPath'],
            },
          },
  • The handleLaunchEditor method: validates projectPath, detects Godot path, checks for project.godot file, then spawns the Godot editor using 'godot -e --path <project>'.
    private async handleLaunchEditor(args: any): Promise<ToolResult> {
      args = this.normalizeParameters(args);
    
      if (!args.projectPath) {
        return this.createErrorResponse('Project path is required');
      }
    
      if (!this.validatePath(args.projectPath)) {
        return this.createErrorResponse('Invalid project path');
      }
    
      try {
        if (!this.godotPath) {
          await this.detectGodotPath();
          if (!this.godotPath) {
            return this.createErrorResponse('Could not find a valid Godot executable path');
          }
        }
    
        const projectFile = join(args.projectPath, 'project.godot');
        if (!existsSync(projectFile)) {
          return this.createErrorResponse(`Not a valid Godot project: ${args.projectPath}`);
        }
    
        this.logDebug(`Launching Godot editor for project: ${args.projectPath}`);
        const process = spawn(this.godotPath, ['-e', '--path', args.projectPath], {
          stdio: 'pipe',
        });
    
        process.on('error', (err: Error) => {
          console.error('Failed to start Godot editor:', err);
        });
    
        return this.createSuccessResponse(`Godot editor launched successfully for project at ${args.projectPath}.`);
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return this.createErrorResponse(`Failed to launch Godot editor: ${errorMessage}`);
      }
    }
  • Input schema for launch_editor: takes a required 'projectPath' string parameter describing the path to the Godot project directory.
    inputSchema: {
      type: 'object',
      properties: {
        projectPath: {
          type: 'string',
          description: 'Path to the Godot project directory',
        },
      },
      required: ['projectPath'],
    },
  • validatePath helper used by handleLaunchEditor to check path validity (rejects null/undefined and paths containing '..').
    private validatePath(path: string): boolean {
      if (!path || path.includes('..')) {
        return false;
      }
      return true;
    }
  • detectGodotPath helper used by handleLaunchEditor to find the Godot executable path from environment variable or common system paths.
    private async detectGodotPath(): Promise<void> {
      if (this.godotPath && await this.isValidGodotPath(this.godotPath)) {
        this.logDebug(`Using existing Godot path: ${this.godotPath}`);
        return;
      }
    
      if (process.env.GODOT_PATH) {
        const normalizedPath = normalize(process.env.GODOT_PATH);
        this.logDebug(`Checking GODOT_PATH environment variable: ${normalizedPath}`);
        if (await this.isValidGodotPath(normalizedPath)) {
          this.godotPath = normalizedPath;
          this.logDebug(`Using Godot path from environment: ${this.godotPath}`);
          return;
        }
      }
    
      const osPlatform = process.platform;
      this.logDebug(`Auto-detecting Godot path for platform: ${osPlatform}`);
    
      const possiblePaths: string[] = ['godot'];
    
      if (osPlatform === 'darwin') {
        possiblePaths.push(
          '/Applications/Godot.app/Contents/MacOS/Godot',
          '/Applications/Godot_4.app/Contents/MacOS/Godot',
          `${process.env.HOME}/Applications/Godot.app/Contents/MacOS/Godot`,
          `${process.env.HOME}/Applications/Godot_4.app/Contents/MacOS/Godot`,
          `${process.env.HOME}/Library/Application Support/Steam/steamapps/common/Godot Engine/Godot.app/Contents/MacOS/Godot`
        );
      } else if (osPlatform === 'win32') {
        possiblePaths.push(
          'C:\\Program Files\\Godot\\Godot.exe',
          'C:\\Program Files (x86)\\Godot\\Godot.exe',
          'C:\\Program Files\\Godot_4\\Godot.exe',
          'C:\\Program Files (x86)\\Godot_4\\Godot.exe',
          `${process.env.USERPROFILE}\\Godot\\Godot.exe`
        );

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only states the action without any side effects, blocking behavior, or requirements (e.g., whether it opens a new window, requires an existing project, or modifies any files). This is insufficient for an agent to predict the tool's impact.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—a single sentence with no filler. However, it is under-specified rather than efficiently comprehensive. It lacks necessary details about behavior and usage, so while it is short, it doesn't earn its place by providing full value. A 3 reflects the balance between brevity and adequacy.

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 tool has one parameter, no output schema, and no annotations, the description should provide enough context to call it correctly. It states the action but omits critical information such as whether the editor must be installed, whether the path must point to a valid project, and whether the call is blocking or returns immediately. This is incomplete for an agent to use confidently.

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 coverage is 100%, so the parameter projectPath is fully documented in the schema. The description adds no additional semantics beyond the action, but the schema already explains the parameter. Baseline 3 is appropriate; the description doesn't harm, but it also doesn't enhance the parameter meaning.

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 (launch) and the resource (Godot editor) for a specific project. It distinguishes implicitly from siblings like run_project (which runs the project rather than opening the editor) and list_projects (which lists projects). However, it doesn't explicitly name the alternative or the selection criteria, so it's clear but not maximally differentiating.

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?

No guidance is provided on when to use this tool versus alternatives such as run_project. The description does not mention any prerequisites, use cases, or conditions that would lead an agent to select this tool over its siblings. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.