Skip to main content
Glama

enhance_prd

Improve product requirements documents by adding missing elements, enhancing clarity, and providing comprehensive analysis using AI-powered tools.

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

  • Main handler function executeEnhancePRD that 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
        });
      }
    }
  • Tool definition enhancePRDTool including name, description, input schema (enhancePRDSchema), and usage examples.
    export const enhancePRDTool: ToolDefinition<EnhancePRDArgs> = {
      name: "enhance_prd",
      description: "Enhance an existing PRD with AI-powered improvements, adding missing elements, improving clarity, and providing comprehensive analysis",
      schema: enhancePRDSchema as unknown as ToolSchema<EnhancePRDArgs>,
      examples: [
        {
          name: "Enhance PRD with technical focus",
          description: "Enhance a basic PRD with detailed technical requirements",
          args: {
            prdContent: "# Basic App PRD\n\n## Overview\nWe want to build a task management app...\n\n## Features\n- Create tasks\n- Assign tasks\n- Track progress",
            enhancementType: "technical",
            focusAreas: ["technical requirements", "architecture", "scalability"],
            includeResearch: false,
            targetAudience: "technical",
            addMissingElements: true,
            improveExisting: true,
            validateQuality: true
          }
        }
      ]
    };
  • Registration of enhancePRDTool in the ToolRegistry's registerBuiltInTools method, making it available for list_tools and validation.
    // 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:377-378 (registration)
    Direct handler dispatch in the main server switch statement for executing the enhance_prd tool.
    case "enhance_prd":
      return await executeEnhancePRD(args);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'AI-powered improvements' but doesn't detail how the enhancement works, what permissions or inputs are needed, whether changes are reversible, or what the output format looks like. For a tool with 9 parameters and no annotations, this leaves significant gaps in understanding its behavior.

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 redundancy and wastes no words, though it could benefit from more structured guidance for such a complex tool.

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, 7 required), lack of annotations, and no output schema, the description is incomplete. It doesn't explain how enhancements are applied, what the output entails, or handle the many parameters. For a tool with this level of complexity, 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.

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'adding missing elements, improving clarity, and providing comprehensive analysis,' which loosely relates to some parameters like 'addMissingElements' and 'improveExisting,' but doesn't explain the purpose or usage of the 9 parameters (e.g., 'enhancementType', 'focusAreas', 'includeResearch'). This fails to adequately clarify 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: '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 ('AI-powered improvements'), though it doesn't explicitly distinguish it from sibling tools like 'generate_prd' or 'parse_prd'.

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. It doesn't mention sibling tools like 'generate_prd' (for creating new PRDs) or 'parse_prd' (for analyzing existing ones), nor does it specify prerequisites or exclusions for usage.

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/HarshKumarSharma/MCP'

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