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
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | The task to estimate | |
| factors | No | Factors affecting complexity |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"factors": {
"description": "Factors affecting complexity",
"items": {
"type": "string"
},
"type": "array"
},
"task": {
"description": "The task to estimate",
"type": "string"
}
},
"required": [
"task"
],
"type": "object"
}
Implementation Reference
- src/tools/cognitive.ts:472-514 (handler)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 }] }; }
- src/tools/cognitive.ts:463-470 (schema)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";