update_task
Modify existing tasks by updating their title, description, status, or priority to maintain accurate productivity tracking within the TodoPomo system.
Instructions
Update an existing task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | Task ID | |
| title | No | New title | |
| description | No | New description | |
| status | No | New status | |
| priority | No | New priority |
Implementation Reference
- src/index.ts:306-342 (handler)Handler function for the 'update_task' tool. It locates the task by ID, updates specified fields (title, description, status, priority), sets completion timestamp if status is 'completed', persists changes to data file, and returns the updated task or error if not found.case "update_task": { const taskIndex = data.tasks.findIndex((t) => t.id === args.taskId); if (taskIndex === -1) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: "Task not found" }), }, ], }; } const task = data.tasks[taskIndex]; if (args.title) task.title = args.title as string; if (args.description) task.description = args.description as string; if (args.status) { task.status = args.status as "pending" | "in-progress" | "completed"; if (args.status === "completed") { task.completedAt = new Date().toISOString(); } } if (args.priority) task.priority = args.priority as "low" | "medium" | "high"; saveData(data); return { content: [ { type: "text", text: JSON.stringify( { success: true, task, message: "Task updated successfully" }, null, 2 ), }, ], }; }
- src/index.ts:130-152 (schema)Input schema definition for the 'update_task' tool, including name, description, properties (taskId required, others optional), enums for status and priority.{ name: "update_task", description: "Update an existing task", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "Task ID" }, title: { type: "string", description: "New title" }, description: { type: "string", description: "New description" }, status: { type: "string", enum: ["pending", "in-progress", "completed"], description: "New status", }, priority: { type: "string", enum: ["low", "medium", "high"], description: "New priority", }, }, required: ["taskId"], }, },
- src/index.ts:245-247 (registration)Registration of the ListTools handler that exposes all tools including 'update_task' via the TOOLS array.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));