Skip to main content
Glama

generate_prd

Create structured product requirements documents by defining product vision, target audience, business objectives, functional requirements, and constraints.

Instructions

PRD|product requirements document|product requirements|requirements document|spec document - Generate Product Requirements Document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productNameYesproduct or feature name
productVisionYeshigh-level vision and goals
targetAudienceNotarget users and stakeholders
businessObjectivesNobusiness objectives and success metrics
functionalRequirementsNocore features and requirements
constraintsNotechnical or business constraints

Implementation Reference

  • The main handler function that executes the generate_prd tool. It takes input arguments and constructs a comprehensive Product Requirements Document (PRD) with sections like executive summary, functional requirements, etc., and returns it formatted as Markdown text.
    export async function generatePrd(args: {
      productName: string;
      productVision: string;
      targetAudience?: string;
      businessObjectives?: string;
      functionalRequirements?: string;
      constraints?: string;
    }): Promise<ToolResult> {
      const {
        productName,
        productVision,
        targetAudience = 'General users',
        businessObjectives = 'Improve user experience and business value',
        functionalRequirements = 'Core functionality to be defined',
        constraints = 'Standard technical and budget constraints'
      } = args;
    
      const prd = {
        action: 'generate_prd',
        product: productName,
        document: {
          title: `Product Requirements Document: ${productName}`,
          version: '1.0',
          date: new Date().toISOString().split('T')[0],
          sections: {
            executiveSummary: {
              title: 'Executive Summary',
              content: `${productName} is designed to ${productVision}. This document outlines the requirements, scope, and implementation strategy for delivering value to ${targetAudience}.`
            },
            productOverview: {
              title: 'Product Overview',
              vision: productVision,
              objectives: businessObjectives,
              targetUsers: targetAudience,
              successMetrics: [
                'User adoption rate',
                'Feature usage metrics',
                'User satisfaction score',
                'Business impact measurement',
                'Performance benchmarks',
                'Retention rates',
                'Conversion rates'
              ]
            },
            functionalRequirements: {
              title: 'Functional Requirements',
              description: functionalRequirements,
              coreFeatures: [
                'User authentication and management',
                'Core functionality implementation',
                'Data processing and storage',
                'User interface and experience',
                'Integration capabilities',
                'Reporting and analytics',
                'Notification and alert system'
              ],
              userFlows: [
                'User onboarding process',
                'Main feature usage flow',
                'Error handling and recovery',
                'Administrative functions',
                'Settings and customization',
                'Data export and import',
                'Help and support access'
              ]
            },
            nonFunctionalRequirements: {
              title: 'Non-Functional Requirements',
              performance: 'Fast response times (<2s), high availability (99.9%)',
              security: 'Data encryption, secure authentication, privacy compliance',
              scalability: 'Support growing user base and data volume',
              usability: 'Intuitive interface, accessibility standards',
              compatibility: 'Cross-platform support, browser compatibility'
            },
            constraints: {
              title: 'Constraints and Assumptions',
              technical: constraints,
              timeline: 'Development timeline to be defined based on scope',
              budget: 'Budget allocation for development and infrastructure',
              resources: 'Team capacity and skill requirements'
            },
            implementationPlan: {
              title: 'Implementation Strategy',
              phases: [
                'Phase 1: Core functionality development',
                'Phase 2: Advanced features and integrations',
                'Phase 3: Performance optimization and scaling',
                'Phase 4: Launch and post-launch improvements'
              ],
              riskMitigation: [
                'Technical risk assessment and mitigation',
                'Resource and timeline risk management',
                'Market and user acceptance risks',
                'Compliance and security considerations'
              ]
            }
          }
        },
        recommendations: [
          'Conduct user research to validate assumptions',
          'Create detailed wireframes and prototypes',
          'Define detailed acceptance criteria for each feature',
          'Set up monitoring and analytics for success metrics',
          'Plan for iterative development and feedback loops',
          'Allocate resources for post-launch support and improvements',
          'Establish clear communication channels among stakeholders',
          'Regularly review and update the PRD as needed'
        ],
        status: 'success'
      };
    
      const formattedPrd = `# ${prd.document.title}
    
    **Version:** ${prd.document.version}
    **Date:** ${prd.document.date}
    
    ## ${prd.document.sections.executiveSummary.title}
    ${prd.document.sections.executiveSummary.content}
    
    ## ${prd.document.sections.productOverview.title}
    **Vision:** ${prd.document.sections.productOverview.vision}
    **Objectives:** ${prd.document.sections.productOverview.objectives}
    **Target Users:** ${prd.document.sections.productOverview.targetUsers}
    
    **Success Metrics:**
    ${prd.document.sections.productOverview.successMetrics.map(metric => `- ${metric}`).join('\n')}
    
    ## ${prd.document.sections.functionalRequirements.title}
    ${prd.document.sections.functionalRequirements.description}
    
    **Core Features:**
    ${prd.document.sections.functionalRequirements.coreFeatures.map(feature => `- ${feature}`).join('\n')}
    
    **User Flows:**
    ${prd.document.sections.functionalRequirements.userFlows.map(flow => `- ${flow}`).join('\n')}
    
    ## ${prd.document.sections.nonFunctionalRequirements.title}
    - **Performance:** ${prd.document.sections.nonFunctionalRequirements.performance}
    - **Security:** ${prd.document.sections.nonFunctionalRequirements.security}
    - **Scalability:** ${prd.document.sections.nonFunctionalRequirements.scalability}
    - **Usability:** ${prd.document.sections.nonFunctionalRequirements.usability}
    - **Compatibility:** ${prd.document.sections.nonFunctionalRequirements.compatibility}
    
    ## ${prd.document.sections.constraints.title}
    - **Technical:** ${prd.document.sections.constraints.technical}
    - **Timeline:** ${prd.document.sections.constraints.timeline}
    - **Budget:** ${prd.document.sections.constraints.budget}
    - **Resources:** ${prd.document.sections.constraints.resources}
    
    ## ${prd.document.sections.implementationPlan.title}
    **Development Phases:**
    ${prd.document.sections.implementationPlan.phases.map(phase => `- ${phase}`).join('\n')}
    
    **Risk Mitigation:**
    ${prd.document.sections.implementationPlan.riskMitigation.map(risk => `- ${risk}`).join('\n')}
    
    ## Recommendations
    ${prd.recommendations.map(rec => `- ${rec}`).join('\n')}`;
    
      return {
        content: [{ type: 'text', text: formattedPrd }]
      };
    }
  • The ToolDefinition object defining the schema, name, description, input schema, and annotations for the generate_prd tool.
    export const generatePrdDefinition: ToolDefinition = {
      name: 'generate_prd',
      description: 'PRD|product requirements document|product requirements|requirements document|spec document - Generate Product Requirements Document',
      inputSchema: {
        type: 'object',
        properties: {
          productName: { type: 'string', description: 'product or feature name' },
          productVision: { type: 'string', description: 'high-level vision and goals' },
          targetAudience: { type: 'string', description: 'target users and stakeholders' },
          businessObjectives: { type: 'string', description: 'business objectives and success metrics' },
          functionalRequirements: { type: 'string', description: 'core features and requirements' },
          constraints: { type: 'string', description: 'technical or business constraints' }
        },
        required: ['productName', 'productVision']
      },
      annotations: {
        title: 'Generate PRD',
        audience: ['user', 'assistant']
      }
    };
  • src/index.ts:672-673 (registration)
    The dispatch case in the executeToolCall switch statement that registers and calls the generatePrd handler when the tool 'generate_prd' is invoked.
    case 'generate_prd':
      return await generatePrd(args as any) as CallToolResult;
  • src/index.ts:145-145 (registration)
    Inclusion of the generatePrdDefinition in the tools array, registering the tool in the MCP server.
    generatePrdDefinition,
  • src/index.ts:72-72 (registration)
    Import statement bringing in the generatePrd handler and definition for use in the main server.
    import { generatePrd, generatePrdDefinition } from './tools/planning/generatePrd.js';
Behavior2/5

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

Annotations only provide a title ('Generate PRD'), which adds no behavioral information beyond the description. The description itself doesn't disclose any behavioral traits: it doesn't indicate whether this is a read-only operation, what permissions might be needed, whether it modifies existing data, rate limits, or what the output format might be. For a tool with minimal annotations, the description carries the full burden and fails to provide essential behavioral context.

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

Conciseness3/5

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

The description is brief but inefficiently structured. It front-loads with redundant synonyms ('PRD|product requirements document|product requirements|requirements document|spec document') that don't add value, followed by the core function. While concise in length, the repetition wastes space that could be used for more helpful information. It's not appropriately sized for a tool with 6 parameters and no output schema.

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 (6 parameters, no output schema) and minimal annotations, the description is incomplete. It doesn't explain what the tool actually does with the inputs (e.g., generates a structured document, fills a template, uses AI), what the output looks like, or how it relates to sibling tools. The description fails to compensate for the lack of output schema and behavioral annotations, leaving significant gaps in understanding.

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 each parameter clearly documented (e.g., 'productName' as 'product or feature name', 'productVision' as 'high-level vision and goals'). The description adds no parameter semantics beyond what's already in the schema. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline score is 3 even with no param info in the description, which applies here.

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

Purpose2/5

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

The description is essentially a tautology that restates the tool name with synonyms ('PRD|product requirements document|product requirements|requirements document|spec document') followed by 'Generate Product Requirements Document'. While it clarifies that the tool generates PRDs, it doesn't specify what kind of generation this is (e.g., from structured inputs, templates, AI-powered creation) or how it differs from sibling tools like 'analyze_requirements' or 'create_user_stories'. The description lacks a specific verb+resource combination that distinguishes this tool's unique function.

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

Usage Guidelines1/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 any context, prerequisites, or exclusions. Given multiple sibling tools that might overlap with requirements analysis (e.g., 'analyze_requirements', 'create_user_stories', 'feature_roadmap'), the absence of usage guidelines leaves the agent guessing about appropriate scenarios for this specific PRD generation tool.

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/ssdeanx/ssd-ai'

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