Skip to main content
Glama

overseer.infer_phases

Analyzes repository structure to suggest phase definitions by detecting patterns in files, directories, and configurations for project management workflows.

Instructions

Analyzes an existing repository structure to suggest phase definitions based on detected patterns (files, directories, configs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_rootYesRoot path of the repository (absolute path or relative to ~/dev)
optionsNo

Implementation Reference

  • The handler function executing the tool's core logic: resolves repo path, analyzes using RepoAnalyzer, formats suggested phases and detected patterns.
    export async function handleInferPhases(
      args: {
        repo_root: string;
        options?: {
          detect_frameworks?: boolean;
          detect_infrastructure?: boolean;
        };
      },
      configLoader: ConfigLoader
    ): Promise<{
      success: boolean;
      suggested_phases: Array<{
        id: string;
        name: string;
        description: string;
        deliverables: string[];
        done_criteria: string[];
        confidence: number;
        reason: string;
        detected_patterns: string[];
      }>;
      detected_frameworks: string[];
      detected_patterns: Array<{
        type: string;
        name: string;
        confidence: number;
        evidence: string[];
      }>;
    }> {
      try {
        // Resolve repo path
        let repoPath = args.repo_root;
        if (!repoPath.startsWith('/')) {
          repoPath = join(homedir(), 'dev', repoPath);
        }
        repoPath = FSUtils.expandPath(repoPath);
    
        if (!FSUtils.dirExists(repoPath)) {
          return {
            success: false,
            suggested_phases: [],
            detected_frameworks: [],
            detected_patterns: [],
          };
        }
    
        // Analyze repository
        const analysis = RepoAnalyzer.analyzeRepo(repoPath, args.options);
    
        // Extract framework names
        const frameworkNames = analysis.patterns
          .filter(p => p.type === 'framework')
          .map(p => p.name);
    
        // Format suggested phases
        const suggestedPhases = analysis.suggested_phases.map(phase => ({
          id: phase.id,
          name: phase.name,
          description: phase.description,
          deliverables: phase.deliverables,
          done_criteria: phase.done_criteria,
          confidence: phase.confidence,
          reason: phase.reason,
          detected_patterns: phase.detected_patterns,
        }));
    
        return {
          success: true,
          suggested_phases: suggestedPhases,
          detected_frameworks: frameworkNames,
          detected_patterns: analysis.patterns.map(p => ({
            type: p.type,
            name: p.name,
            confidence: p.confidence,
            evidence: p.evidence,
          })),
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          success: false,
          suggested_phases: [],
          detected_frameworks: [],
          detected_patterns: [],
        };
      }
    }
  • Factory function defining the tool's metadata (name, description) and inputSchema for parameter validation.
    export function createInferPhasesTool(configLoader: ConfigLoader): Tool {
      return {
        name: 'overseer.infer_phases',
        description: 'Analyzes an existing repository structure to suggest phase definitions based on detected patterns (files, directories, configs).',
        inputSchema: {
          type: 'object',
          required: ['repo_root'],
          properties: {
            repo_root: {
              type: 'string',
              description: 'Root path of the repository (absolute path or relative to ~/dev)',
            },
            options: {
              type: 'object',
              properties: {
                detect_frameworks: {
                  type: 'boolean',
                  default: true,
                  description: 'Detect framework-specific patterns (Phoenix, Next.js, etc.)',
                },
                detect_infrastructure: {
                  type: 'boolean',
                  default: true,
                  description: 'Detect infrastructure files (Docker, Terraform, K8s)',
                },
              },
            },
          },
        },
      };
    }
  • Tool registration in createTools: adds the infer_phases tool (via createInferPhasesTool) to the list of available MCP tools.
    export function createTools(context: ToolContext): Tool[] {
      return [
        // Planning tools
        createPlanProjectTool(context.phaseManager),
        createInferPhasesTool(context.configLoader),
        createUpdatePhasesTool(context.phaseManager),
        // Execution tools
        createRunPhaseTool(context.phaseManager),
        createAdvancePhaseTool(context.phaseManager),
        createStatusTool(context.phaseManager),
        // QA tools
        createLintRepoTool(context.configLoader),
        createSyncDocsTool(context.phaseManager),
        createCheckComplianceTool(context.phaseManager),
        // Environment tools
        createEnvMapTool(context.phaseManager),
        createGenerateCiTool(context.phaseManager),
        createSecretsTemplateTool(context.phaseManager),
      ];
    }
  • Handler dispatch in handleToolCall switch statement: routes 'overseer.infer_phases' calls to the specific handleInferPhases function.
    case 'overseer.infer_phases':
      return await handleInferPhases(args, context.configLoader);
  • Import statement linking the schema factory and handler from infer-phases.ts module.
    import { createInferPhasesTool, handleInferPhases } from './infer-phases.js';
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions analysis and suggestion but doesn't describe what the tool actually returns (e.g., format of phase definitions), whether it's read-only or has side effects, performance characteristics, or error conditions. For an analysis tool with no annotation coverage, this leaves significant behavioral 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, well-structured sentence that efficiently conveys the core functionality. It's front-loaded with the main action and outcome, with no redundant or verbose language. Every word earns its place.

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 complexity (analysis tool with pattern detection), lack of annotations, no output schema, and incomplete parameter documentation, the description is insufficient. It doesn't explain what 'phase definitions' are, how suggestions are generated, or what the output looks like. For a tool that presumably returns structured analysis results, this leaves too much undefined.

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 50% (one of two parameters has a description). The description adds no specific parameter information beyond what's implied by 'analyzes an existing repository structure' (hinting at repo_root). It doesn't explain the 'options' object or its sub-parameters. With moderate schema coverage, the description provides minimal additional parameter semantics.

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: 'Analyzes an existing repository structure to suggest phase definitions based on detected patterns.' It specifies the verb (analyzes), resource (repository structure), and outcome (suggest phase definitions). However, it doesn't explicitly differentiate from sibling tools like 'overseer.plan_project' or 'overseer.update_phases', which might have related functionality.

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 multiple sibling tools like 'plan_project', 'update_phases', and 'check_compliance' that might involve repository analysis or phase management, there's no indication of this tool's specific context, prerequisites, or exclusions.

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/freqkflag/PROJECT-OVERSEER-MCP'

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