Skip to main content
Glama

list_projects

Find and display Godot projects in a specified directory to help users locate and manage their game development files.

Instructions

List Godot projects in a directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryYesDirectory to search for Godot projects
recursiveNoWhether to search recursively (default: false)

Implementation Reference

  • src/index.ts:729-744 (registration)
    Tool registration including name, description, and input schema for list_projects
    name: 'list_projects',
    description: 'List Godot projects in a directory',
    inputSchema: {
      type: 'object',
      properties: {
        directory: {
          type: 'string',
          description: 'Directory to search for Godot projects',
        },
        recursive: {
          type: 'boolean',
          description: 'Whether to search recursively (default: false)',
        },
      },
      required: ['directory'],
    },
  • Handler function for list_projects tool that normalizes args, validates directory, finds projects using findGodotProjects, and returns JSON list
    private async handleListProjects(args: any) {
      // Normalize parameters to camelCase
      args = this.normalizeParameters(args);
      
      if (!args.directory) {
        return this.createErrorResponse(
          'Directory is required',
          ['Provide a valid directory path to search for Godot projects']
        );
      }
    
      if (!this.validatePath(args.directory)) {
        return this.createErrorResponse(
          'Invalid directory path',
          ['Provide a valid path without ".." or other potentially unsafe characters']
        );
      }
    
      try {
        this.logDebug(`Listing Godot projects in directory: ${args.directory}`);
        if (!existsSync(args.directory)) {
          return this.createErrorResponse(
            `Directory does not exist: ${args.directory}`,
            ['Provide a valid directory path that exists on the system']
          );
        }
    
        const recursive = args.recursive === true;
        const projects = this.findGodotProjects(args.directory, recursive);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(projects, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return this.createErrorResponse(
          `Failed to list projects: ${error?.message || 'Unknown error'}`,
          [
            'Ensure the directory exists and is accessible',
            'Check if you have permission to read the directory',
          ]
        );
      }
    }
  • src/index.ts:944-945 (registration)
    Registration of the handler in the CallToolRequestSchema switch statement
    case 'list_projects':
      return await this.handleListProjects(request.params.arguments);
  • Helper function that implements the core logic to find Godot projects by searching for project.godot files in directories, recursively if specified
    private findGodotProjects(directory: string, recursive: boolean): Array<{ path: string; name: string }> {
      const projects: Array<{ path: string; name: string }> = [];
    
      try {
        // Check if the directory itself is a Godot project
        const projectFile = join(directory, 'project.godot');
        if (existsSync(projectFile)) {
          projects.push({
            path: directory,
            name: basename(directory),
          });
        }
    
        // If not recursive, only check immediate subdirectories
        if (!recursive) {
          const entries = readdirSync(directory, { withFileTypes: true });
          for (const entry of entries) {
            if (entry.isDirectory()) {
              const subdir = join(directory, entry.name);
              const projectFile = join(subdir, 'project.godot');
              if (existsSync(projectFile)) {
                projects.push({
                  path: subdir,
                  name: entry.name,
                });
              }
            }
          }
        } else {
          // Recursive search
          const entries = readdirSync(directory, { withFileTypes: true });
          for (const entry of entries) {
            if (entry.isDirectory()) {
              const subdir = join(directory, entry.name);
              // Skip hidden directories
              if (entry.name.startsWith('.')) {
                continue;
              }
              // Check if this directory is a Godot project
              const projectFile = join(subdir, 'project.godot');
              if (existsSync(projectFile)) {
                projects.push({
                  path: subdir,
                  name: entry.name,
                });
              } else {
                // Recursively search this directory
                const subProjects = this.findGodotProjects(subdir, true);
                projects.push(...subProjects);
              }
            }
          }
        }
      } catch (error) {
        this.logDebug(`Error searching directory ${directory}: ${error}`);
      }
    
      return projects;
    }
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 of behavioral disclosure. It states what the tool does but lacks details on behavioral traits such as whether it's read-only (implied by 'List' but not explicit), error handling for invalid directories, output format (e.g., list of project names or paths), or performance considerations like recursion depth limits. This is a significant gap for a tool with no annotation coverage.

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 that directly states the tool's purpose without any wasted words. It is front-loaded and appropriately sized for a simple listing tool, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (two parameters, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic action but lacks context on output (what 'list' returns), error cases, or how it fits with siblings. Without annotations or output schema, more detail would help the agent use it correctly, but it's not entirely inadequate for a simple operation.

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?

The schema description coverage is 100%, with clear descriptions for both parameters ('directory' and 'recursive'), so the schema does the heavy lifting. The description adds no additional meaning beyond implying the tool searches for projects, which is already covered by the schema. Thus, it meets the baseline score without compensating or detracting.

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 verb ('List') and resource ('Godot projects in a directory'), making the purpose immediately understandable. However, it does not explicitly distinguish this tool from potential siblings like 'get_project_info' or 'update_project_uids', which might also involve project-related operations, so it doesn't reach the highest score for sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't clarify if this is for finding projects to work with versus getting detailed info (as with 'get_project_info'), or if there are prerequisites like needing an existing directory. This lack of context leaves the agent to 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.

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/Zycroft/godot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server