Skip to main content
Glama

analyze_project

Generate initial documentation files by analyzing project structure. Input the project root directory path to create a searchable knowledge base.

Instructions

Analyze project structure and create initial documentation files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the project root directory

Implementation Reference

  • Executes the analyze_project tool: creates .handoff_docs directory, initializes default markdown template files if missing, resets application state, and returns initialization status.
    case "analyze_project": {
      const { projectPath } = request.params.arguments as { projectPath: string };
      const docsPath = `${projectPath}/.handoff_docs`;
    
      try {
        await fs.mkdir(docsPath, { recursive: true });
    
        // Initialize default documentation files if they don't exist
        for (const doc of DEFAULT_DOCS) {
          const filePath = `${docsPath}/${doc}`;
          try {
            await fs.access(filePath);
          } catch {
            const title = doc.replace(".md", "")
              .split(/[_-]/)
              .map(word => word.charAt(0).toUpperCase() + word.slice(1))
              .join(" ");
            await fs.writeFile(filePath, TEMPLATE_CONTENT.replace("{title}", title));
          }
        }
    
        state = {
          currentFile: null,
          completedFiles: [],
          inProgress: false,
          lastReadFile: null,
          lastReadContent: null,
          continueToNext: false,
          metadata: {},
          contextCache: {},
          templateOverrides: {}
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                message: "Documentation structure initialized",
                docsPath,
                files: DEFAULT_DOCS
              }, null, 2)
            }
          ]
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new McpError(
          ErrorCode.InternalError,
          `Error initializing documentation: ${errorMessage}`
        );
      }
    }
  • src/index.ts:418-432 (registration)
    Registers the analyze_project tool with MCP server, defining name, description, and input schema requiring projectPath.
    {
      name: "analyze_project",
      description: "Analyze project structure and create initial documentation files",
      inputSchema: {
        type: "object",
        properties: {
          projectPath: {
            type: "string",
            description: "Path to the project root directory"
          }
        },
        required: ["projectPath"]
      }
    },
    {
  • Input schema for analyze_project tool: requires projectPath string.
    inputSchema: {
      type: "object",
      properties: {
        projectPath: {
          type: "string",
          description: "Path to the project root directory"
        }
      },
      required: ["projectPath"]
    }
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 mentions 'analyze' and 'create', implying read and write operations, but doesn't specify permissions needed, whether files are overwritten, what types of documentation are created, or error handling. For a tool with mutation potential and no annotations, this leaves significant gaps.

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: 'Analyze project structure and create initial documentation files'. It's front-loaded with the core action, has no redundant words, and every part contributes to understanding the tool's purpose. This is appropriately concise for the complexity.

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's complexity (involving analysis and file creation), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'analyze' entails, what documentation files are created, or the return values. For a mutation tool with no structured behavioral data, more detail is needed to guide effective use.

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 input schema has 100% description coverage, with 'projectPath' clearly documented as 'Path to the project root directory'. The description doesn't add any additional meaning beyond this, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the schema handles parameter documentation adequately.

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 tool's purpose: 'Analyze project structure and create initial documentation files'. It specifies the verb ('analyze' and 'create') and resource ('project structure', 'documentation files'), making the action clear. However, it doesn't explicitly differentiate from siblings like 'analyze_existing_docs' or 'get_project_info', which might have overlapping scopes.

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. With siblings such as 'analyze_existing_docs', 'analyze_project_with_metadata', and 'get_project_info', it's unclear if this tool is for new projects, existing ones, or specific contexts. No exclusions or prerequisites are mentioned.

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

Related 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/ryanjoachim/mcp-rtfm'

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