Skip to main content
Glama

analyze_task_complexity

Analyze task complexity, estimate effort, assess risks, and provide actionable recommendations for GitHub project management using AI-powered analysis.

Instructions

Perform detailed AI-powered analysis of task complexity, effort estimation, risk assessment, and provide actionable recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskTitleYes
taskDescriptionYes
currentEstimateNo
teamExperienceYes
projectContextNo
includeBreakdownYes
includeRisksYes
includeRecommendationsYes

Implementation Reference

  • Main handler function that executes the analyze_task_complexity tool: creates mock task, performs AI analysis via TaskGenerationService, generates breakdowns/risks/recommendations/confidence, and formats the response.
    async function executeAnalyzeTaskComplexity(args: AnalyzeTaskComplexityArgs): Promise<MCPResponse> {
      const taskService = new TaskGenerationService();
    
      try {
        // Create a mock task for analysis
        const mockTask = {
          id: 'analysis-task',
          title: args.taskTitle,
          description: args.taskDescription,
          complexity: 5 as TaskComplexity, // Will be updated by analysis
          estimatedHours: args.currentEstimate || 0,
          priority: TaskPriority.MEDIUM,
          status: TaskStatus.PENDING,
          dependencies: [],
          acceptanceCriteria: [],
          tags: [],
          aiGenerated: false,
          subtasks: [],
          createdAt: new Date().toISOString(),
          updatedAt: new Date().toISOString()
        };
    
        // Perform complexity analysis
        const analysis = await taskService.analyzeTaskComplexity(mockTask);
    
        // Generate detailed breakdown
        const breakdown = generateEffortBreakdown(analysis.estimatedHours, args.teamExperience);
    
        // Assess risks
        const risks = args.includeRisks ? assessTaskRisks(args, analysis) : [];
    
        // Generate recommendations
        const recommendations = args.includeRecommendations ?
          generateTaskRecommendations(args, analysis, risks) : [];
    
        // Calculate confidence level
        const confidence = calculateConfidenceLevel(args, analysis);
    
        // Format response
        const summary = formatComplexityAnalysis(args, analysis, breakdown, risks, recommendations, confidence);
    
        return ToolResultFormatter.formatSuccess('analyze_task_complexity', {
          summary,
          analysis: {
            originalComplexity: mockTask.complexity,
            newComplexity: analysis.newComplexity,
            estimatedHours: analysis.estimatedHours,
            confidence,
            breakdown,
            risks,
            recommendations
          }
        });
    
      } catch (error) {
        process.stderr.write(`Error in analyze_task_complexity tool: ${error}\n`);
        return ToolResultFormatter.formatSuccess('analyze_task_complexity', {
          error: `Failed to analyze task complexity: ${error instanceof Error ? error.message : 'Unknown error'}`,
          success: false
        });
      }
    }
  • Zod schema defining input parameters for the analyze_task_complexity tool
    const analyzeTaskComplexitySchema = z.object({
      taskTitle: z.string().min(3).describe('Title of the task to analyze'),
      taskDescription: z.string().min(10).describe('Detailed description of the task'),
      currentEstimate: z.number().optional().describe('Current effort estimate in hours (if any)'),
      teamExperience: z.enum(['junior', 'mid', 'senior', 'mixed']).default('mixed')
        .describe('Team experience level'),
      projectContext: z.string().optional().describe('Additional project context'),
      includeBreakdown: z.boolean().default(true).describe('Whether to include effort breakdown'),
      includeRisks: z.boolean().default(true).describe('Whether to include risk analysis'),
      includeRecommendations: z.boolean().default(true).describe('Whether to include recommendations')
    });
  • Registration of the analyzeTaskComplexityTool (and other AI tools) in the central ToolRegistry during built-in tools initialization
    // 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);
  • ToolDefinition export including name, description, schema reference, and usage examples
    export const analyzeTaskComplexityTool: ToolDefinition<AnalyzeTaskComplexityArgs> = {
      name: "analyze_task_complexity",
      description: "Perform detailed AI-powered analysis of task complexity, effort estimation, risk assessment, and provide actionable recommendations",
      schema: analyzeTaskComplexitySchema as unknown as ToolSchema<AnalyzeTaskComplexityArgs>,
      examples: [
        {
          name: "Analyze complex feature task",
          description: "Analyze the complexity of implementing a new feature",
          args: {
            taskTitle: "Implement real-time chat system",
            taskDescription: "Build a WebSocket-based real-time chat system with message history, file sharing, user presence indicators, and message encryption",
            currentEstimate: 20,
            teamExperience: "mixed",
            projectContext: "Adding to existing React/Node.js application",
            includeBreakdown: true,
            includeRisks: true,
            includeRecommendations: true
          }
        }
      ]
    };
  • Dispatch handler in main MCP server that routes tool calls to executeAnalyzeTaskComplexity
    case "analyze_task_complexity":
      return await executeAnalyzeTaskComplexity(args);
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 mentions 'AI-powered analysis' which implies computational processing, but doesn't describe output format, potential latency, rate limits, authentication needs, or whether it's read-only vs. mutative. For an 8-parameter analysis tool with zero 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.

Conciseness4/5

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

The description is a single, efficient sentence that packs multiple analysis components. It's appropriately sized for the tool's complexity and front-loads the core purpose. No wasted words, though it could benefit from more structural separation of the different analysis aspects.

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, 6 required), no annotations, no output schema, and 0% schema description coverage, the description is inadequate. It mentions analysis components but doesn't explain what the analysis produces, how parameters interact, or what the agent can expect as results. For an AI analysis tool with rich inputs, this leaves too many unanswered questions.

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 all 8 parameters are undocumented in the schema. The description mentions 'task complexity, effort estimation, risk assessment, and actionable recommendations' which partially maps to some parameters (e.g., taskTitle, taskDescription, includeRisks, includeRecommendations), but doesn't explain parameter purposes, formats, or relationships. It fails to compensate for the complete lack of schema documentation.

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 performs AI-powered analysis of task complexity with specific components: effort estimation, risk assessment, and actionable recommendations. It uses specific verbs ('analyze', 'estimate', 'assess', 'provide') and identifies the resource (task complexity). However, it doesn't explicitly differentiate from sibling tools like 'expand_task' or 'get_next_task' that might also involve task analysis.

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. With many sibling tools for task/project management (e.g., 'expand_task', 'plan_sprint', 'get_next_task'), there's no indication of appropriate contexts, prerequisites, or exclusions. The description only states what it does, not when it should be used.

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