Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

create_traceability_matrix

Generate a traceability matrix linking PRD requirements to features, use cases, and tasks with bidirectional tracking for project management.

Instructions

Create a comprehensive requirements traceability matrix linking PRD business requirements → features → use cases → tasks with full bidirectional traceability

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
prdContentYes
featuresYes
tasksYes
includeUseCasesYes
includeTraceabilityLinksYes
includeCoverageAnalysisYes
validateCompletenessYes

Implementation Reference

  • The primary handler function that executes the tool's core logic: creates mock PRD, converts tasks, calls RequirementsTraceabilityService.createTraceabilityMatrix, validates completeness, and formats the output.
    async function executeCreateTraceabilityMatrix(args: CreateTraceabilityMatrixArgs): Promise<MCPResponse> {
      const traceabilityService = new RequirementsTraceabilityService();
    
      try {
        // Create mock PRD from content
        const mockPRD = {
          id: `prd-${args.projectId}`,
          title: `PRD for ${args.projectId}`,
          overview: args.prdContent.substring(0, 500),
          objectives: extractObjectivesFromContent(args.prdContent),
          successMetrics: extractSuccessMetricsFromContent(args.prdContent),
          features: args.features,
          author: 'system',
          createdAt: new Date().toISOString(),
          updatedAt: new Date().toISOString(),
          aiGenerated: true,
          aiMetadata: {
            generatedBy: 'create-traceability-matrix',
            generatedAt: new Date().toISOString(),
            prompt: 'Extract PRD elements for traceability matrix',
            confidence: 0.8,
            version: '1.0.0'
          }
        };
    
        // Convert input tasks to AITask format
        const aiTasks = args.tasks.map(task => ({
          ...task,
          priority: task.priority as TaskPriority,
          complexity: task.complexity as TaskComplexity,
          status: TaskStatus.PENDING,
          dependencies: [],
          acceptanceCriteria: [],
          tags: [],
          aiGenerated: true,
          subtasks: [],
          createdAt: new Date().toISOString(),
          updatedAt: new Date().toISOString()
        }));
    
        // Create comprehensive traceability matrix
        const traceabilityMatrix = traceabilityService.createTraceabilityMatrix(
          args.projectId,
          mockPRD as any,
          args.features as any,
          aiTasks
        );
    
        // Validate completeness if requested
        let validation;
        if (args.validateCompleteness) {
          validation = validateTraceabilityCompleteness(traceabilityMatrix);
        }
    
        // Format response
        const summary = formatTraceabilityMatrixSummary(traceabilityMatrix, validation, args);
    
        return ToolResultFormatter.formatSuccess('create_traceability_matrix', {
          summary,
          traceabilityMatrix,
          validation,
          coverage: traceabilityMatrix.coverage,
          totalRequirements: traceabilityMatrix.businessRequirements.length,
          totalFeatures: traceabilityMatrix.features.length,
          totalUseCases: traceabilityMatrix.useCases.length,
          totalTasks: traceabilityMatrix.tasks.length
        });
    
      } catch (error) {
        process.stderr.write(`Error in create_traceability_matrix tool: ${error}\n`);
        return ToolResultFormatter.formatSuccess('create_traceability_matrix', {
          error: `Failed to create traceability matrix: ${error instanceof Error ? error.message : 'Unknown error'}`,
          success: false
        });
      }
    }
  • Zod schema defining the input structure and validation for the create_traceability_matrix tool, including projectId, prdContent, features, tasks, and various boolean flags.
    const createTraceabilityMatrixSchema = z.object({
      projectId: z.string().describe('ID of the project to create traceability matrix for'),
      prdContent: z.string().min(100).describe('PRD content to extract business requirements from'),
      features: z.array(z.object({
        id: z.string(),
        title: z.string(),
        description: z.string(),
        priority: z.enum(['critical', 'high', 'medium', 'low']),
        userStories: z.array(z.string()),
        acceptanceCriteria: z.array(z.string()),
        estimatedComplexity: z.number().min(1).max(10)
      })).describe('List of features to include in traceability'),
      tasks: z.array(z.object({
        id: z.string(),
        title: z.string(),
        description: z.string(),
        complexity: z.number().min(1).max(10),
        estimatedHours: z.number(),
        priority: z.enum(['critical', 'high', 'medium', 'low'])
      })).describe('List of tasks to include in traceability'),
      includeUseCases: z.boolean().default(true).describe('Whether to generate use cases from features'),
      includeTraceabilityLinks: z.boolean().default(true).describe('Whether to generate traceability links'),
      includeCoverageAnalysis: z.boolean().default(true).describe('Whether to include coverage analysis'),
      validateCompleteness: z.boolean().default(true).describe('Whether to validate traceability completeness')
    });
  • Registration of the createTraceabilityMatrixTool in the central ToolRegistry singleton during initialization of built-in AI task management tools.
    this.registerTool(createTraceabilityMatrixTool);
  • src/index.ts:462-463 (registration)
    Dispatch case in the main MCP server tool handler switch statement that routes calls to the create_traceability_matrix tool to its execution function.
    case "create_traceability_matrix":
      return await executeCreateTraceabilityMatrix(args);
  • Core helper method in RequirementsTraceabilityService that builds the traceability matrix by extracting requirements from PRD, generating use cases, enhancing tasks with traceability info, creating links, and calculating coverage metrics.
    createTraceabilityMatrix(
      projectId: string,
      prd: PRDDocument,
      features: FeatureRequirement[],
      tasks: AITask[]
    ): TraceabilityMatrix {
      // Extract business requirements from PRD
      const businessRequirements = this.extractBusinessRequirementsFromPRD(prd);
    
      // Generate use cases from features
      const useCases = features.flatMap(feature =>
        this.generateUseCasesFromFeature(feature, businessRequirements)
      );
    
      // Enhance tasks with traceability
      const enhancedTasks = this.enhanceTasksWithTraceability(
        tasks, useCases, features, businessRequirements, prd.id
      );
    
      // Create traceability links
      const traceabilityLinks = this.generateTraceabilityLinks(
        businessRequirements, features, useCases, enhancedTasks
      );
    
      // Calculate coverage
      const coverage = this.calculateCoverage(
        businessRequirements, features, useCases, enhancedTasks
      );
    
      return {
        id: `tm-${projectId}-${Date.now()}`,
        projectId,
        prdId: prd.id,
        businessRequirements,
        features: features as EnhancedFeatureRequirement[], // Type assertion for now
        useCases,
        tasks: enhancedTasks,
        traceabilityLinks,
        coverage,
        createdAt: new Date().toISOString(),
        updatedAt: new Date().toISOString(),
        version: '1.0.0'
      };
    }
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 states the tool 'create[s]' something, implying a write/mutation operation, but doesn't specify whether this requires specific permissions, what format the output takes (e.g., a file, report, or database entry), or any side effects like overwriting existing data. For a complex creation tool with 8 parameters and no annotation coverage, this is a significant gap in transparency.

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 action ('Create a comprehensive requirements traceability matrix') and elaborates on its scope. There's no wasted text, though it could benefit from slight structuring (e.g., breaking into clauses) for even clearer readability. Overall, it's appropriately sized for the tool's 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 (8 parameters, no annotations, no output schema), the description is incomplete. It outlines the tool's purpose but lacks crucial details: no explanation of parameter semantics, no behavioral context (e.g., output format, error handling), and no usage guidelines. This leaves the agent poorly equipped to invoke the tool correctly, especially with 100% required parameters and nested objects in arrays.

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

Parameters1/5

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

Schema description coverage is 0%, meaning none of the 8 parameters are documented in the schema. The description mentions 'PRD business requirements', 'features', 'use cases', and 'tasks', which loosely map to parameters like 'prdContent', 'features', and 'tasks', but it doesn't explain their formats, purposes, or how they interrelate. It omits parameters like 'projectId', 'includeUseCases', and others entirely, failing to compensate for the schema's lack of documentation.

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

Purpose5/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 with specific verbs ('create') and resources ('requirements traceability matrix'), detailing what it links (PRD business requirements → features → use cases → tasks) and specifying 'full bidirectional traceability'. It distinguishes itself from sibling tools like 'create_roadmap' or 'generate_prd' by focusing on traceability mapping rather than general project creation or documentation generation.

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 explicit guidance on when to use this tool versus alternatives. While it implies usage for traceability mapping, it doesn't mention prerequisites (e.g., needing existing PRD content), exclusions, or comparisons to similar tools like 'create_roadmap' or 'enhance_prd' that might handle related project documentation tasks. This leaves the agent without clear contextual boundaries.

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