Skip to main content
Glama

estimate_complexity

Estimates task complexity and effort requirements by analyzing tasks and influencing factors to help plan development work effectively.

Instructions

Estimates the complexity and effort required for a task or feature.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesThe task to estimate
factorsNoFactors affecting complexity

Implementation Reference

  • The handler function for 'estimate_complexity' tool. It receives task description and optional factors, generates a structured Markdown report estimating effort breakdown, total hours (optimistic/realistic/pessimistic), complexity score, risks, and recommendations.
    export function estimateComplexityHandler(args: any) {
        const { task, factors = [] } = args;
    
        const estimate = `# Complexity Estimate: ${task}
    
    ## Complexity Factors
    ${factors.length > 0 ? factors.map((f: string) => `- ${f}`).join("\n") : "Standard complexity assumed"}
    
    ---
    
    ## Effort Breakdown
    
    | Component | Effort | Risk |
    |-----------|--------|------|
    | Research/Design | 1-2 hours | Low |
    | Core Implementation | 2-4 hours | Medium |
    | Testing | 1-2 hours | Low |
    | Edge Cases | 1-2 hours | Medium |
    | Documentation | 0.5-1 hour | Low |
    | Review/Refinement | 1 hour | Low |
    
    ## Total Estimate
    - **Optimistic**: 6-8 hours
    - **Realistic**: 8-12 hours
    - **Pessimistic**: 12-16 hours
    
    ## Complexity Score
    **Medium** (3/5)
    
    ## Risk Factors
    - [ ] Unknown dependencies
    - [ ] Integration complexity
    - [ ] Performance requirements
    - [ ] Security considerations
    
    ## Recommendations
    - Break into smaller tasks if estimate > 8 hours
    - Add buffer for unknowns (20-30%)
    - Identify blockers early
    `;
    
        return { content: [{ type: "text", text: estimate }] };
    }
  • The input schema definition using Zod for validating the tool's parameters: required 'task' string and optional 'factors' array.
    export const estimateComplexitySchema = {
        name: "estimate_complexity",
        description: "Estimates the complexity and effort required for a task or feature.",
        inputSchema: z.object({
            task: z.string().describe("The task to estimate"),
            factors: z.array(z.string()).optional().describe("Factors affecting complexity")
        })
    };
  • src/index.ts:85-85 (registration)
    Registration of the 'estimate_complexity' tool in the main toolRegistry Map used by the stdio MCP server.
    ["estimate_complexity", { schema: estimateComplexitySchema, handler: estimateComplexityHandler }],
  • src/server.ts:95-95 (registration)
    Registration of the 'estimate_complexity' tool in the toolRegistry Map used by the HTTP MCP server.
    ["estimate_complexity", { schema: estimateComplexitySchema, handler: estimateComplexityHandler }],
  • src/index.ts:33-43 (registration)
    Import statement that brings in the estimateComplexitySchema and estimateComplexityHandler from cognitive.ts for use in tool registration.
    import {
        planTaskSchema, planTaskHandler,
        reflectOnCodeSchema, reflectOnCodeHandler,
        analyzeArchitectureSchema, analyzeArchitectureHandler,
        debugProblemSchema, debugProblemHandler,
        brainstormSolutionsSchema, brainstormSolutionsHandler,
        compareApproachesSchema, compareApproachesHandler,
        estimateComplexitySchema, estimateComplexityHandler,
        generateTestsSchema, generateTestsHandler,
        explainCodeSchema, explainCodeHandler
    } from "./tools/cognitive.js";

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/millsydotdev/Code-MCP'

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