update_task
Modify the title or description of an uncompleted task in the task manager. Displays a progress table with the updated task details after changes are applied.
Instructions
Update an existing task's title and/or description. Only uncompleted tasks can be updated.
A progress table will be displayed showing the updated task information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| requestId | Yes | ||
| taskId | Yes | ||
| title | No |
Implementation Reference
- index.ts:617-646 (handler)Implements the core logic for updating an uncompleted task's title and/or description, persists changes, and provides a progress table.public async updateTask( requestId: string, taskId: string, updates: { title?: string; description?: string } ) { await this.loadTasks(); const req = this.data.requests.find((r) => r.requestId === requestId); if (!req) return { status: "error", message: "Request not found" }; const task = req.tasks.find((t) => t.id === taskId); if (!task) return { status: "error", message: "Task not found" }; if (task.done) return { status: "error", message: "Cannot update completed task" }; if (updates.title) task.title = updates.title; if (updates.description) task.description = updates.description; await this.saveTasks(); const progressTable = this.formatTaskProgressTable(requestId); return { status: "task_updated", message: `Task ${taskId} has been updated.\n${progressTable}`, task: { id: task.id, title: task.title, description: task.description, }, }; }
- index.ts:87-93 (schema)Zod schema defining the input parameters for the update_task tool.const UpdateTaskSchema = z.object({ requestId: z.string(), taskId: z.string(), title: z.string().optional(), description: z.string().optional(), });
- index.ts:250-265 (registration)Defines the Tool object for 'update_task' including name, description, and input schema, used for registration.const UPDATE_TASK_TOOL: Tool = { name: "update_task", description: "Update an existing task's title and/or description. Only uncompleted tasks can be updated.\n\n" + "A progress table will be displayed showing the updated task information.", inputSchema: { type: "object", properties: { requestId: { type: "string" }, taskId: { type: "string" }, title: { type: "string" }, description: { type: "string" }, }, required: ["requestId", "taskId"], }, };
- index.ts:684-696 (registration)Registers UPDATE_TASK_TOOL in the list returned by ListToolsRequestHandler.tools: [ REQUEST_PLANNING_TOOL, GET_NEXT_TASK_TOOL, MARK_TASK_DONE_TOOL, APPROVE_TASK_COMPLETION_TOOL, APPROVE_REQUEST_COMPLETION_TOOL, OPEN_TASK_DETAILS_TOOL, LIST_REQUESTS_TOOL, ADD_TASKS_TO_REQUEST_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, ], }));
- index.ts:814-827 (handler)MCP server request handler for 'update_task': validates args with schema and delegates to TaskManagerServer.updateTask.case "update_task": { const parsed = UpdateTaskSchema.safeParse(args); if (!parsed.success) { throw new Error(`Invalid arguments: ${parsed.error}`); } const { requestId, taskId, title, description } = parsed.data; const result = await taskManagerServer.updateTask(requestId, taskId, { title, description, }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }