Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

enhance_prd

Improve product requirements documents by adding missing elements, enhancing clarity, and providing AI-powered analysis for better project planning.

Instructions

Enhance an existing PRD with AI-powered improvements, adding missing elements, improving clarity, and providing comprehensive analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prdContentYes
enhancementTypeYes
focusAreasNo
includeResearchYes
targetAudienceYes
industryContextNo
addMissingElementsYes
improveExistingYes
validateQualityYes

Implementation Reference

  • Core handler function implementing the 'enhance_prd' tool. Orchestrates PRD enhancement using PRDGenerationService, validation, feature extraction, summary generation, and response formatting.
    async function executeEnhancePRD(args: EnhancePRDArgs): Promise<MCPResponse> {
      const prdService = new PRDGenerationService();
      
      try {
        // Enhance the PRD using AI
        const enhancedPRD = await prdService.enhancePRD({
          currentPRD: args.prdContent,
          enhancementType: args.enhancementType,
          focusAreas: args.focusAreas
        });
    
        // Validate the enhanced PRD if requested
        let validation;
        if (args.validateQuality) {
          validation = await prdService.validatePRDCompleteness(enhancedPRD);
        }
    
        // Extract features for analysis
        const features = await prdService.extractFeaturesFromPRD(JSON.stringify(enhancedPRD));
    
        // Generate enhancement summary
        const enhancementSummary = generateEnhancementSummary(
          args.prdContent, 
          enhancedPRD, 
          args.enhancementType,
          args.focusAreas
        );
    
        // Format response
        const summary = formatPRDEnhancement(
          enhancedPRD, 
          validation, 
          features, 
          enhancementSummary, 
          args
        );
        
        return ToolResultFormatter.formatSuccess('enhance_prd', {
          summary,
          enhancedPRD,
          validation,
          features,
          enhancementSummary,
          qualityScore: validation?.score || 0
        });
    
      } catch (error) {
        process.stderr.write(`Error in enhance_prd tool: ${error}\n`);
        return ToolResultFormatter.formatSuccess('enhance_prd', {
          error: `Failed to enhance PRD: ${error instanceof Error ? error.message : 'Unknown error'}`,
          success: false
        });
      }
    }
  • Zod schema defining input parameters for the enhance_prd tool, including PRD content, enhancement type, focus areas, and various enhancement options.
    // Schema for enhance_prd tool
    const enhancePRDSchema = z.object({
      prdContent: z.string().min(100).describe('The existing PRD content to enhance'),
      enhancementType: z.enum(['comprehensive', 'technical', 'user_focused', 'business_focused'])
        .describe('Type of enhancement to apply'),
      focusAreas: z.array(z.string()).optional()
        .describe('Specific areas to focus on (e.g., "user personas", "technical requirements")'),
      includeResearch: z.boolean().default(false)
        .describe('Whether to include market research and competitive analysis'),
      targetAudience: z.enum(['technical', 'business', 'mixed']).default('mixed')
        .describe('Target audience for the enhanced PRD'),
      industryContext: z.string().optional()
        .describe('Industry or domain context for enhancement'),
      addMissingElements: z.boolean().default(true)
        .describe('Whether to add commonly missing PRD elements'),
      improveExisting: z.boolean().default(true)
        .describe('Whether to improve existing sections'),
      validateQuality: z.boolean().default(true)
        .describe('Whether to validate and score the enhanced PRD')
    });
  • Registration of the enhancePRDTool in the central ToolRegistry singleton instance during construction.
    // Register AI task management tools
    this.registerTool(addFeatureTool);
    this.registerTool(generatePRDTool);
    this.registerTool(parsePRDTool);
    this.registerTool(getNextTaskTool);
    this.registerTool(analyzeTaskComplexityTool);
    this.registerTool(expandTaskTool);
    this.registerTool(enhancePRDTool);
    this.registerTool(createTraceabilityMatrixTool);
  • src/index.ts:459-460 (registration)
    Dispatch handler in main server that routes 'enhance_prd' tool calls to the executeEnhancePRD function.
    case "enhance_prd":
      return await executeEnhancePRD(args);
  • Helper service method called by the tool handler to perform the actual AI-powered PRD enhancement using AITaskProcessor.
    async enhancePRD(params: {
      currentPRD: PRDDocument | string;
      enhancementType: 'comprehensive' | 'technical' | 'user_focused' | 'business_focused';
      focusAreas?: string[];
      includeResearch?: boolean;
    }): Promise<PRDDocument> {
      try {
        const currentPRDContent = typeof params.currentPRD === 'string'
          ? params.currentPRD
          : JSON.stringify(params.currentPRD, null, 2);
    
        const enhancedPRD = await this.aiProcessor.enhancePRD({
          currentPRD: currentPRDContent,
          enhancementType: params.enhancementType,
          focusAreas: params.focusAreas
        });
    
        // If we started with a PRD object, preserve some original metadata
        if (typeof params.currentPRD === 'object') {
          enhancedPRD.id = params.currentPRD.id;
          enhancedPRD.createdAt = params.currentPRD.createdAt;
          enhancedPRD.author = params.currentPRD.author;
          enhancedPRD.version = this.incrementVersion(params.currentPRD.version);
        }
    
        return PRDDocumentSchema.parse(enhancedPRD);
      } catch (error) {
        process.stderr.write(`Error enhancing PRD: ${error instanceof Error ? error.message : String(error)}\n`);
        throw new Error(`Failed to enhance PRD: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
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. While it mentions 'AI-powered improvements' and lists enhancement types, it doesn't cover critical aspects like whether this is a read-only or mutation operation, potential side effects, authentication needs, rate limits, or output format. For a tool with 9 parameters and no annotations, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids unnecessary words and gets straight to the point. However, it could be more structured by separating the 'what' from the 'how' aspects of enhancement.

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 (9 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain what the tool returns, how enhancements are applied, error conditions, or the relationship between parameters. For a tool that presumably modifies content, this leaves too many unknowns for proper agent usage.

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

Parameters2/5

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

With 0% schema description coverage and 9 parameters (7 required), the description provides no information about parameter meanings, relationships, or usage. It doesn't explain what 'enhancementType' values represent, how 'focusAreas' should be used, or what format 'prdContent' expects. The description fails to compensate for the complete lack of schema documentation.

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: 'Enhance an existing PRD with AI-powered improvements, adding missing elements, improving clarity, and providing comprehensive analysis.' It specifies the verb ('enhance'), resource ('existing PRD'), and scope of improvements. However, it doesn't explicitly differentiate from sibling tools like 'generate_prd' or 'parse_prd', which would be needed for a score of 5.

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. There's no mention of prerequisites, when not to use it, or how it differs from related tools like 'generate_prd' or 'enrich_issue'. The agent must infer usage from the purpose statement 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/kunwarVivek/mcp-github-project-manager'

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