update_task
Modify an existing task's details like title, status, priority, due date, or assignee to keep project information current and accurate.
Instructions
Update an existing task with new information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The unique identifier of the task to update | |
| title | No | New title for the task | |
| description | No | New description for the task | |
| status | No | New status for the task | |
| priority | No | New priority for the task | |
| due_date | No | New due date for the task (ISO 8601 format) | |
| assignee_id | No | New assignee for the task | |
| initiative_id | No | New initiative ID to associate the task with |
Implementation Reference
- src/tools/tasks.ts:255-271 (handler)Core execution logic for the 'update_task' tool: validates args with schema, logs action, delegates to supabaseService.updateTask, returns updated task.export const updateTask = requireAuth(async (args: any) => { const { task_id, ...updates } = UpdateTaskSchema.parse(args) logger.info('Updating task', { task_id, updates }) // Handle status change logic // completed_at property removed as it doesn't exist in the database schema const task = await supabaseService.updateTask(task_id, updates) logger.info('Task updated successfully', { task_id: task.id }) return { task, message: `Task "${task.title}" updated successfully` } })
- src/tools/tasks.ts:37-47 (schema)Zod input validation schema for update_task tool.const UpdateTaskSchema = z.object({ task_id: z.string().uuid(), title: z.string().min(1).max(500).optional(), description: z.string().optional(), status: z.enum(['todo', 'in_progress', 'done']).optional(), priority: z.enum(['low', 'medium', 'high']).optional(), due_date: z.string().datetime().optional(), assignee_id: z.string().uuid().optional(), initiative_id: z.string().uuid().optional() // Removed metadata as it doesn't exist in the database schema })
- src/tools/tasks.ts:203-253 (registration)MCPTool registration defining name 'update_task', description, and input schema for the tool.export const updateTaskTool: MCPTool = { name: 'update_task', description: 'Update an existing task with new information', inputSchema: { type: 'object', properties: { task_id: { type: 'string', format: 'uuid', description: 'The unique identifier of the task to update' }, title: { type: 'string', minLength: 1, maxLength: 500, description: 'New title for the task' }, description: { type: 'string', description: 'New description for the task' }, status: { type: 'string', enum: ['todo', 'in_progress', 'done'], description: 'New status for the task' }, priority: { type: 'string', enum: ['low', 'medium', 'high'], description: 'New priority for the task' }, due_date: { type: 'string', format: 'date-time', description: 'New due date for the task (ISO 8601 format)' }, assignee_id: { type: 'string', format: 'uuid', description: 'New assignee for the task' }, initiative_id: { type: 'string', format: 'uuid', description: 'New initiative ID to associate the task with' }, // Removed metadata as it doesn't exist in the database schema }, required: ['task_id'] } }
- src/tools/tasks.ts:1157-1166 (registration)Registration of task handlers in taskHandlers object, mapping 'update_task' to the updateTask function.export const taskHandlers = { list_tasks: listTasks, create_task: createTask, get_task: getTask, update_task: updateTask, add_task_dependency: addTaskDependency, get_task_dependencies: getTaskDependencies, create_task_workflow: createTaskWorkflow, bulk_update_tasks: bulkUpdateTasks, get_task_workflow_status: getTaskWorkflowStatus
- src/lib/api-client.ts:436-443 (helper)supabaseService.updateTask helper method called by the tool handler; makes PATCH request to backend API to update task.async updateTask(taskId: string, updates: Partial<Task>): Promise<Task> { const response = await this.request<{ task: Task }>(`/api/mcp/tasks/${taskId}`, { method: 'PATCH', body: JSON.stringify(updates), }) return response.task }