add_todo
Add a new task to your software development plan with title, description, complexity score, and optional code example for implementation tracking.
Instructions
Add a new todo item to the current plan
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the todo item | |
| description | Yes | Detailed description of the todo item | |
| complexity | Yes | Complexity score (0-10) | |
| codeExample | No | Optional code example |
Implementation Reference
- src/index.ts:254-276 (handler)MCP tool handler for 'add_todo' which checks for current goal, extracts todo arguments, delegates to storage.addTodo, and returns the created todo as JSON text.case 'add_todo': { if (!this.currentGoal) { throw new McpError( ErrorCode.InvalidRequest, 'No active goal. Start a new planning session first.' ); } const todo = request.params.arguments as Omit< Todo, 'id' | 'isComplete' | 'createdAt' | 'updatedAt' >; const newTodo = await storage.addTodo(this.currentGoal.id, todo); return { content: [ { type: 'text', text: JSON.stringify(newTodo, null, 2), }, ], }; }
- src/index.ts:144-167 (schema)Input JSON schema for the 'add_todo' tool defining required title, description, complexity and optional codeExample.inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Title of the todo item', }, description: { type: 'string', description: 'Detailed description of the todo item', }, complexity: { type: 'number', description: 'Complexity score (0-10)', minimum: 0, maximum: 10, }, codeExample: { type: 'string', description: 'Optional code example', }, }, required: ['title', 'description', 'complexity'], },
- src/index.ts:141-168 (registration)Registration of the 'add_todo' tool in the ListToolsRequestSchema handler's tools array.{ name: 'add_todo', description: 'Add a new todo item to the current plan', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Title of the todo item', }, description: { type: 'string', description: 'Detailed description of the todo item', }, complexity: { type: 'number', description: 'Complexity score (0-10)', minimum: 0, maximum: 10, }, codeExample: { type: 'string', description: 'Optional code example', }, }, required: ['title', 'description', 'complexity'], }, },
- src/storage.ts:71-96 (helper)Helper function in storage that implements adding a todo: fetches plan, creates full Todo object, appends to plan, saves to JSON file, returns todo.async addTodo( goalId: string, { title, description, complexity, codeExample }: Omit<Todo, 'id' | 'isComplete' | 'createdAt' | 'updatedAt'> ): Promise<Todo> { const plan = await this.getPlan(goalId); if (!plan) { throw new Error(`No plan found for goal ${goalId}`); } const todo: Todo = { id: Date.now().toString(), title, description, complexity, codeExample, isComplete: false, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), }; plan.todos.push(todo); plan.updatedAt = new Date().toISOString(); await this.save(); return todo; }