update_task
Modify the title or description of an existing uncompleted task in the MCP TaskManager queue, then view the updated progress table.
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 |
|---|---|---|---|
| requestId | Yes | ||
| taskId | Yes | ||
| title | No | ||
| description | No |
Implementation Reference
- index.ts:529-561 (handler)The main handler function for the update_task tool. Finds the specified request and task, validates that the task is editable (not done or approved), applies optional title and description updates, persists changes via saveTasks, and returns a confirmation message with the updated task progress table.public async updateTask( requestId: string, taskId: string, updates: { title?: string; description?: string } ) { const request = this.data.requests.find((r) => r.requestId === requestId); if (!request) { throw new Error("Request not found"); } const task = request.tasks.find((t) => t.id === taskId); if (!task) { throw new Error("Task not found"); } if (task.done || task.approved) { throw new Error("Cannot update completed or approved tasks"); } if (updates.title) { task.title = updates.title; } if (updates.description) { task.description = updates.description; } await this.saveTasks(); return { message: "Task updated successfully.\n" + this.formatTaskProgressTable(requestId), }; }
- index.ts:78-83 (schema)Zod schema defining the input validation for update_task: required requestId and taskId, optional title and description.const UpdateTaskSchema = z.object({ requestId: z.string(), taskId: z.string(), title: z.string().optional(), description: z.string().optional(), });
- index.ts:185-189 (registration)Tool registration entry in the listTools() method's return array, defining the tool's name, description, and input schema.{ name: "update_task", description: "Update an existing task.", inputSchema: UpdateTaskSchema, },