todo_complete
Mark tasks as completed in your checklist by specifying the list and task titles. Simplify progress tracking and stay organized with this MCP TODO Checklist Server tool.
Instructions
Marca uma tarefa como concluída
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listTitle | Yes | Título da lista | |
| taskTitle | Yes | Título da tarefa |
Implementation Reference
- src/index.ts:230-247 (handler)Main handler for the 'todo_complete' tool. Validates input using completeSchema, retrieves the user's checklists, finds the specific list and task by title, and toggles the task's completion status via ChecklistService.toggleItemComplete.case "todo_complete": { console.error('DEBUG - Processing todo_complete'); const params = completeSchema.parse(args); const todoLists = await checklistService.getUserChecklists('current-user'); const todoList = todoLists.find(l => l.title === params.listTitle); if (!todoList) { throw new Error(`Lista não encontrada: ${params.listTitle}`); } const task = todoList.items.find(t => t.title === params.taskTitle); if (!task) { throw new Error(`Tarefa não encontrada: ${params.taskTitle}`); } await checklistService.toggleItemComplete(todoList.id, task.id); return { content: [{ type: "text", text: `Tarefa "${params.taskTitle}" marcada como completa!` }] }; }
- src/index.ts:50-53 (schema)Zod validation schema for 'todo_complete' tool input parameters: listTitle and taskTitle.const completeSchema = z.object({ listTitle: z.string(), taskTitle: z.string() });
- src/index.ts:145-156 (registration)Tool registration in ListTools response, including name, description, and inputSchema definition.{ name: "todo_complete", description: "Marca uma tarefa como concluída", inputSchema: { type: "object", properties: { listTitle: { type: "string", description: "Título da lista" }, taskTitle: { type: "string", description: "Título da tarefa" }, }, required: ["listTitle", "taskTitle"], }, },
- Helper method in ChecklistService that toggles the 'completed' status of a specific checklist item by calling updateItem.async toggleItemComplete(checklistId: string, itemId: string): Promise<ChecklistItem> { const checklist = await this.getChecklist(checklistId); const item = checklist.items.find(item => item.id === itemId); if (!item) { throw new Error(`Item not found: ${itemId}`); } return this.updateItem(checklistId, itemId, { completed: !item.completed }); } }