Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

enrich_issue

Automatically enhance GitHub issues by adding labels, priority, type, complexity, and effort estimates using AI analysis.

Instructions

AI-powered issue enrichment. Automatically adds labels, priority, type, complexity, and effort estimates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
issueIdYes
issueNumberYes
issueTitleYes
issueDescriptionNo
projectContextNo
autoApplyNo

Implementation Reference

  • Handler function that processes 'enrich_issue' tool calls, delegates to IssueEnrichmentService, and optionally auto-applies changes
    private async handleEnrichIssue(args: any): Promise<any> {
      try {
        const enrichment = await this.enrichmentService.enrichIssue({
          projectId: args.projectId,
          issueId: args.issueId,
          issueTitle: args.issueTitle,
          issueDescription: args.issueDescription,
          projectContext: args.projectContext
        });
    
        if (args.autoApply) {
          await this.enrichmentService.applyEnrichment({
            projectId: args.projectId,
            issueNumber: args.issueNumber,
            enrichment,
            applyLabels: true
          });
        }
    
        return {
          success: true,
          enrichment
        };
      } catch (error) {
        this.logger.error("Failed to enrich issue:", error);
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to enrich issue: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • Switch case dispatcher for 'enrich_issue' tool in main executeToolHandler
    case "enrich_issue":
      return await this.handleEnrichIssue(args);
  • Tool definition including name, description, input schema, and examples for 'enrich_issue'
    export const enrichIssueTool: ToolDefinition<EnrichIssueArgs> = {
      name: "enrich_issue",
      description: "AI-powered issue enrichment. Automatically adds labels, priority, type, complexity, and effort estimates.",
      schema: enrichIssueSchema as unknown as ToolSchema<EnrichIssueArgs>,
      examples: [
        {
          name: "Enrich issue",
          description: "Add tags and metadata to an issue",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            issueId: "I_kwDOJrIzLs5eGXAT",
            issueNumber: 42,
            issueTitle: "Add user authentication",
            issueDescription: "Implement OAuth 2.0 authentication",
            autoApply: true
          }
        }
      ]
    };
  • Zod input schema validation for 'enrich_issue' tool parameters
    export const enrichIssueSchema = z.object({
      projectId: z.string().min(1, "Project ID is required"),
      issueId: z.string().min(1, "Issue ID is required"),
      issueNumber: z.number().int().positive(),
      issueTitle: z.string().min(1, "Issue title is required"),
      issueDescription: z.string().optional(),
      projectContext: z.string().optional(),
      autoApply: z.boolean().default(false).optional()
    });
    
    export type EnrichIssueArgs = z.infer<typeof enrichIssueSchema>;
  • Registers the 'enrichIssueTool' in the central ToolRegistry singleton
    this.registerTool(enrichIssueTool);
  • Core enrichment logic using AI to analyze issue and suggest labels, priority, type, complexity, effort, etc.
    async enrichIssue(params: {
      projectId: string;
      issueId: string;
      issueTitle: string;
      issueDescription?: string;
      projectContext?: string;
      existingLabels?: string[];
      milestones?: Array<{ title: string; description: string }>;
    }): Promise<IssueEnrichmentResult> {
      try {
        this.logger.info(`Enriching issue: ${params.issueTitle}`);
    
        const model = this.aiFactory.getModel('main') || this.aiFactory.getBestAvailableModel();
        if (!model) {
          throw new Error('AI service is not available');
        }
    
        const prompt = `You are an expert project manager. Analyze this issue and provide enrichment as JSON: {"suggestedLabels":[],"suggestedPriority":"medium","suggestedType":"task","complexity":"moderate","estimatedEffort":"2 hours","relatedIssues":[],"reasoning":"..."}`;
    
        const response = await generateText({
          model,
          prompt: `${prompt}\n\nIssue: ${params.issueTitle}\nDescription: ${params.issueDescription || 'None'}`,
          temperature: 0.5,
          maxTokens: 1000
        });
    
        const jsonMatch = response.text.match(/\{[\s\S]*\}/);
        if (!jsonMatch) {
          throw new Error('Failed to parse AI response');
        }
    
        const enrichment = JSON.parse(jsonMatch[0]);
        return { issueId: params.issueId, ...enrichment };
      } catch (error) {
        this.logger.error(`Failed to enrich issue ${params.issueId}`, error);
        throw error;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool 'automatically adds' metadata, implying a write/mutation operation, but doesn't clarify permissions required, whether changes are reversible, rate limits, or what happens if enrichment fails. For a tool with 7 parameters and 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 extremely concise—two brief sentences that efficiently state the core functionality. Every word earns its place with no redundancy or fluff. It's front-loaded with the main purpose ('AI-powered issue enrichment') followed by specific actions.

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 (7 parameters, no annotations, no output schema), the description is incomplete. It explains what the tool does at a high level but lacks crucial details: parameter meanings, behavioral traits (e.g., mutation impact), output format, or error handling. For a tool that likely modifies issues, this leaves too many unknowns for reliable agent 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 schema provides no parameter documentation. The description doesn't mention any parameters, leaving all 7 (including 4 required) unexplained. It fails to compensate for the coverage gap, not even hinting at what 'projectId', 'issueId', etc., represent or how 'autoApply' affects behavior.

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: 'AI-powered issue enrichment' with specific actions like 'adds labels, priority, type, complexity, and effort estimates.' It distinguishes from siblings like 'triage_issue' or 'analyze_task_complexity' by focusing on automated enrichment rather than manual triage or standalone analysis. However, it doesn't explicitly differentiate from 'enrich_issues_bulk' regarding batch vs. single issue processing.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing issue), compare to 'enrich_issues_bulk' for multiple issues, or specify when automated enrichment is appropriate versus manual updates. The description implies usage for AI-driven metadata addition but lacks explicit context 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/kunwarVivek/mcp-github-project-manager'

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