Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

expand_task

Break down complex GitHub project tasks into manageable subtasks with AI analysis, dependency detection, and implementation recommendations.

Instructions

Break down a complex task into smaller, manageable subtasks with AI-powered analysis, dependency detection, and implementation recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskTitleYes
taskDescriptionYes
currentComplexityYes
maxSubtasksYes
maxDepthYes
targetComplexityYes
includeEstimatesYes
includeDependenciesYes
includeAcceptanceCriteriaYes
projectTypeNo
teamSkillsNo

Implementation Reference

  • Main handler function that executes the expand_task tool logic: creates mock parent task, generates subtasks via TaskGenerationService, enhances with details/dependencies/metrics/recommendations, and formats comprehensive response.
    async function executeExpandTask(args: ExpandTaskArgs): Promise<MCPResponse> {
      const taskService = new TaskGenerationService();
    
      try {
        // Create a mock parent task
        const parentTask = {
          id: 'parent-task',
          title: args.taskTitle,
          description: args.taskDescription,
          complexity: args.currentComplexity as TaskComplexity,
          estimatedHours: args.currentComplexity * 4, // Simple estimation
          priority: TaskPriority.MEDIUM,
          status: TaskStatus.PENDING,
          dependencies: [],
          acceptanceCriteria: [],
          tags: [],
          aiGenerated: false,
          subtasks: [],
          createdAt: new Date().toISOString(),
          updatedAt: new Date().toISOString()
        };
    
        // Generate subtasks using AI
        const subtasks = await taskService.expandTaskIntoSubtasks({
          task: parentTask,
          maxDepth: args.maxDepth,
          autoEstimate: args.includeEstimates
        });
    
        // Enhance subtasks with additional details
        const enhancedSubtasks = enhanceSubtasks(subtasks, args);
    
        // Detect dependencies if requested
        const dependencies = args.includeDependencies ?
          detectSubtaskDependencies(enhancedSubtasks) : [];
    
        // Calculate metrics
        const metrics = calculateSubtaskMetrics(enhancedSubtasks, parentTask);
    
        // Generate recommendations
        const recommendations = generateSubtaskRecommendations(enhancedSubtasks, args, metrics);
    
        // Format response
        const summary = formatTaskExpansion(
          parentTask,
          enhancedSubtasks,
          dependencies,
          metrics,
          recommendations,
          args
        );
    
        return ToolResultFormatter.formatSuccess('expand_task', {
          summary,
          parentTask,
          subtasks: enhancedSubtasks,
          dependencies,
          metrics,
          recommendations
        });
    
      } catch (error) {
        process.stderr.write(`Error in expand_task tool: ${error}\n`);
        return ToolResultFormatter.formatSuccess('expand_task', {
          error: `Failed to expand task: ${error instanceof Error ? error.message : 'Unknown error'}`,
          success: false
        });
      }
    }
  • Zod schema defining input validation and types for expand_task tool parameters.
    const expandTaskSchema = z.object({
      taskTitle: z.string().min(3).describe('Title of the task to expand'),
      taskDescription: z.string().min(10).describe('Detailed description of the task'),
      currentComplexity: z.number().min(1).max(10).describe('Current complexity score of the task'),
      maxSubtasks: z.number().min(2).max(15).default(8).describe('Maximum number of subtasks to create'),
      maxDepth: z.number().min(1).max(3).default(2).describe('Maximum depth of subtask breakdown'),
      targetComplexity: z.number().min(1).max(5).default(3).describe('Target complexity for each subtask'),
      includeEstimates: z.boolean().default(true).describe('Whether to include effort estimates for subtasks'),
      includeDependencies: z.boolean().default(true).describe('Whether to identify dependencies between subtasks'),
      includeAcceptanceCriteria: z.boolean().default(true).describe('Whether to generate acceptance criteria for subtasks'),
      projectType: z.string().optional().describe('Type of project (web-app, mobile-app, api, etc.)'),
      teamSkills: z.array(z.string()).optional().describe('Team skills to consider for subtask assignment')
    });
  • Registration of the expandTaskTool in the central ToolRegistry singleton, making it available for list_tools and validation.
    this.registerTool(expandTaskTool);
  • Dispatcher switch case in main MCP server that routes expand_task calls to the executeExpandTask handler.
    case "expand_task":
      return await executeExpandTask(args);
  • Complete ToolDefinition export for expand_task, including name, description, schema reference, and usage example.
    export const expandTaskTool: ToolDefinition<ExpandTaskArgs> = {
      name: "expand_task",
      description: "Break down a complex task into smaller, manageable subtasks with AI-powered analysis, dependency detection, and implementation recommendations",
      schema: expandTaskSchema as unknown as ToolSchema<ExpandTaskArgs>,
      examples: [
        {
          name: "Expand complex feature task",
          description: "Break down a complex feature into manageable subtasks",
          args: {
            taskTitle: "Implement user dashboard",
            taskDescription: "Create a comprehensive user dashboard with analytics, settings, notifications, and profile management",
            currentComplexity: 8,
            maxSubtasks: 6,
            maxDepth: 2,
            targetComplexity: 3,
            includeEstimates: true,
            includeDependencies: true,
            includeAcceptanceCriteria: true,
            projectType: "web-app",
            teamSkills: ["react", "typescript", "node.js"]
          }
        }
      ]
    };
    
    // Export the execution function
    export { executeExpandTask };
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