todo_complete
Mark checklist tasks as completed by specifying list and task titles to track progress and maintain organized workflows.
Instructions
Marca uma tarefa como concluída
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"listTitle": "<listTitle>",
"taskTitle": "<taskTitle>"
},
"name": "todo_complete"
}
}Input 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)Handler for the 'todo_complete' tool. Parses input arguments using completeSchema, locates the specified checklist and task by title, toggles the task's completion status via checklistService.toggleItemComplete, and returns a success message.
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 schema for validating input parameters of the todo_complete tool: listTitle and taskTitle.
const completeSchema = z.object({ listTitle: z.string(), taskTitle: z.string() }); - src/index.ts:145-156 (registration)Registration of the 'todo_complete' tool in the ListTools response, including name, description, and input schema.
{ 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 completion status of a checklist item by updating it with the inverted completed flag.
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 }); }