Skip to main content
Glama

run_project

Launch and execute Godot game projects to capture runtime output and debug information for development testing.

Instructions

Run the Godot project and capture output

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the Godot project directory
sceneNoOptional: Specific scene to run

Implementation Reference

  • The handler function for the 'run_project' tool. Validates input, spawns a Godot process in debug mode (-d flag), captures stdout and stderr into activeProcess for later retrieval via get_debug_output, handles process events.
    private async handleRunProject(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 {
        // 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',
            ]
          );
        }
    
        // Kill any existing process
        if (this.activeProcess) {
          this.logDebug('Killing existing Godot process before starting a new one');
          this.activeProcess.process.kill();
        }
    
        const cmdArgs = ['-d', '--path', args.projectPath];
        if (args.scene && this.validatePath(args.scene)) {
          this.logDebug(`Adding scene parameter: ${args.scene}`);
          cmdArgs.push(args.scene);
        }
    
        this.logDebug(`Running Godot project: ${args.projectPath}`);
        const process = spawn(this.godotPath!, cmdArgs, { stdio: 'pipe' });
        const output: string[] = [];
        const errors: string[] = [];
    
        process.stdout?.on('data', (data: Buffer) => {
          const lines = data.toString().split('\n');
          output.push(...lines);
          lines.forEach((line: string) => {
            if (line.trim()) this.logDebug(`[Godot stdout] ${line}`);
          });
        });
    
        process.stderr?.on('data', (data: Buffer) => {
          const lines = data.toString().split('\n');
          errors.push(...lines);
          lines.forEach((line: string) => {
            if (line.trim()) this.logDebug(`[Godot stderr] ${line}`);
          });
        });
    
        process.on('exit', (code: number | null) => {
          this.logDebug(`Godot process exited with code ${code}`);
          if (this.activeProcess && this.activeProcess.process === process) {
            this.activeProcess = null;
          }
        });
    
        process.on('error', (err: Error) => {
          console.error('Failed to start Godot process:', err);
          if (this.activeProcess && this.activeProcess.process === process) {
            this.activeProcess = null;
          }
        });
    
        this.activeProcess = { process, output, errors };
    
        return {
          content: [
            {
              type: 'text',
              text: `Godot project started in debug mode. Use get_debug_output to see output.`,
            },
          ],
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return this.createErrorResponse(
          `Failed to run Godot project: ${errorMessage}`,
          [
            'Ensure Godot is installed correctly',
            'Check if the GODOT_PATH environment variable is set correctly',
            'Verify the project path is accessible',
          ]
        );
      }
    }
  • Input schema definition for the run_project tool, specifying projectPath as required and scene as optional.
      name: 'run_project',
      description: 'Run the Godot project and capture output',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'Path to the Godot project directory',
          },
          scene: {
            type: 'string',
            description: 'Optional: Specific scene to run',
          },
        },
        required: ['projectPath'],
      },
    },
  • src/index.ts:936-937 (registration)
    Registration of the run_project handler in the CallToolRequestSchema switch statement.
    case 'run_project':
      return await this.handleRunProject(request.params.arguments);
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 'capture output', which hints at read behavior, but lacks critical details: whether this starts a long-running process, requires specific permissions, has side effects like file changes, or handles errors. For a tool that likely executes code, this is a significant gap in safety and operational context.

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 action ('run the Godot project') and adds a useful detail ('capture output') without redundancy. Every word earns its place, making it highly concise 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 tool likely executes a project (a complex operation with potential side effects), the description is incomplete. No annotations exist to clarify safety or behavior, and there's no output schema to explain return values. The description lacks details on execution mode, error handling, or output format, leaving significant gaps for an agent to use it correctly.

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 fully documents both parameters ('projectPath' and optional 'scene'). The description adds no additional meaning beyond implying these inputs are used to run the project. Baseline 3 is appropriate as the schema handles the heavy lifting, but the description doesn't compensate with extra context like format examples or constraints.

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 ('run') and target ('Godot project'), and mentions capturing output as an additional effect. It distinguishes from siblings like 'launch_editor' (which likely opens the editor UI) and 'stop_project' (which terminates execution). However, it doesn't explicitly differentiate from all siblings, such as 'get_debug_output' which might retrieve logs without running.

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 explicit guidance is provided on when to use this tool versus alternatives. The description implies it's for executing a project, but it doesn't specify prerequisites (e.g., whether the project must be valid or compiled), when to choose this over 'launch_editor' for testing, or if it's intended for headless runs versus interactive sessions.

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