Skip to main content
Glama

list_projects

List all analyzed projects to retrieve their names, paths, and last analysis timestamps for a quick codebase overview.

Instructions

List all projects that have been analyzed by CodeAtlas. Returns project names, paths, and last analysis time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:132-154 (registration)
    Registration of the 'list_projects' tool on the MCP server, including its description (empty schema, no params) and handler callback.
    // Tool 0: List all discovered projects
    server.tool(
      "list_projects",
      "List all projects that have been analyzed by CodeAtlas. Returns project names, paths, and last analysis time.",
      {},
      async () => {
        const projects = discoverProjects();
        if (projects.length === 0) {
          return { content: [{ type: "text" as const, text: "No analyzed projects found. Run 'CodeAtlas: Analyze Project' in VS Code first." }] };
        }
    
        const result = {
          projectCount: projects.length,
          projects: projects.map((p) => ({
            name: p.name,
            path: p.dir,
            lastAnalyzed: p.modifiedAt.toISOString(),
          })),
        };
    
        return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Handler function for list_projects: calls discoverProjects(), formats results with project count, name, path, and lastAnalyzed timestamp, returns as JSON string.
    async () => {
      const projects = discoverProjects();
      if (projects.length === 0) {
        return { content: [{ type: "text" as const, text: "No analyzed projects found. Run 'CodeAtlas: Analyze Project' in VS Code first." }] };
      }
    
      const result = {
        projectCount: projects.length,
        projects: projects.map((p) => ({
          name: p.name,
          path: p.dir,
          lastAnalyzed: p.modifiedAt.toISOString(),
        })),
      };
    
      return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
    }
  • The discoverProjects() helper function that scans directories (env var, cwd, home children) for .codeatlas/analysis.json files and returns sorted project info.
    function discoverProjects(): { name: string; dir: string; analysisPath: string; modifiedAt: Date }[] {
      const projects: { name: string; dir: string; analysisPath: string; modifiedAt: Date }[] = [];
      const homeDir = process.env.HOME || process.env.USERPROFILE || "/home";
    
      // Scan directories for .codeatlas/analysis.json
      const searchDirs: string[] = [];
    
      // Add env var project if specified
      if (process.env.CODEATLAS_PROJECT_DIR) {
        searchDirs.push(process.env.CODEATLAS_PROJECT_DIR);
      }
    
      // Add cwd
      searchDirs.push(process.cwd());
    
      // Scan home directory children (max depth 2)
      try {
        const homeDirs = fs.readdirSync(homeDir);
        for (const d of homeDirs) {
          if (d.startsWith(".")) continue;
          const fullPath = path.join(homeDir, d);
          try {
            if (fs.statSync(fullPath).isDirectory()) {
              searchDirs.push(fullPath);
            }
          } catch { /* skip */ }
        }
      } catch { /* skip */ }
    
      // Check each directory for .codeatlas/analysis.json
      const seen = new Set<string>();
      for (const dir of searchDirs) {
        const analysisPath = path.join(dir, ".codeatlas", "analysis.json");
        if (seen.has(analysisPath)) continue;
        seen.add(analysisPath);
    
        if (fs.existsSync(analysisPath)) {
          try {
            const stat = fs.statSync(analysisPath);
            projects.push({
              name: path.basename(dir),
              dir,
              analysisPath,
              modifiedAt: stat.mtime,
            });
          } catch { /* skip */ }
        }
      }
    
      // Sort by most recently modified
      projects.sort((a, b) => b.modifiedAt.getTime() - a.modifiedAt.getTime());
      return projects;
    }
  • Schema for list_projects: an empty object ({}) meaning no input parameters are required.
    {},
Behavior4/5

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

With no annotations, the description carries the full burden. It correctly implies a read operation (list) and returns data. No hidden behaviors are suggested, and there is no contradiction with annotations.

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?

A single, front-loaded sentence with no wasted words. Every part is essential and immediately conveys the tool's purpose and output.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, no output schema), the description fully covers what an agent needs: what it lists and what is returned. No gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, so description doesn't need to explain them. Baseline for 0 parameters is 4, and the description adds no unnecessary parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') and resource ('projects that have been analyzed by CodeAtlas'), clearly distinguishing it from sibling tools like 'get_project_structure' which targets a single project.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly states the tool lists all analyzed projects, providing clear context for when to use it. However, it does not explicitly exclude other tools or mention alternatives, so it falls short of a 5.

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/giauphan/codeatlas-mcp'

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