bulk_update_tasks
Update multiple tasks simultaneously by applying status, priority, assignee, or due date changes to selected task IDs, with optional dependency cascade.
Instructions
Update multiple tasks at once
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_ids | Yes | Array of task IDs to update | |
| updates | Yes | Updates to apply to all tasks | |
| cascade_dependencies | No | Whether to update dependent tasks automatically |
Implementation Reference
- src/tools/tasks.ts:792-837 (handler)The main handler function that implements the bulk_update_tasks tool logic. It validates input using Zod schema, loops through task IDs to update each task via supabaseService, optionally handles cascading dependencies for 'done' status, catches errors per task, and returns a summary with results.export const bulkUpdateTasks = requireAuth(async (args: any) => { const { task_ids, updates, cascade_dependencies } = BulkUpdateTasksSchema.parse(args) logger.info('Bulk updating tasks', { task_count: task_ids.length, updates, cascade_dependencies }) const results = [] const now = new Date().toISOString() for (const task_id of task_ids) { try { const updateData = { ...updates, updated_at: now } // Handle status change cascading if (updates.status === 'done' && cascade_dependencies) { await handleTaskCompletion(task_id) } const result = await supabaseService.updateTask(task_id, updateData) results.push({ task_id, success: true, task: result }) } catch (error) { logger.error(`Failed to update task ${task_id}:`, error) results.push({ task_id, success: false, error: error instanceof Error ? error.message : 'Unknown error' }) } } return { summary: { total_tasks: task_ids.length, successful_updates: results.filter(r => r.success).length, failed_updates: results.filter(r => !r.success).length }, results, applied_updates: updates } })
- src/tools/tasks.ts:781-790 (schema)Zod schema used for input validation and parsing in the bulkUpdateTasks handler.const BulkUpdateTasksSchema = z.object({ task_ids: z.array(z.string().min(1)).min(1), updates: z.object({ status: z.enum(['todo', 'in_progress', 'done']).optional(), priority: z.enum(['low', 'medium', 'high']).optional(), assignee_id: z.string().optional(), due_date: z.string().datetime().optional() }), cascade_dependencies: z.boolean().default(false) })
- src/tools/tasks.ts:750-779 (registration)MCPTool object definition for bulk_update_tasks, including name, description, and JSON input schema.export const bulkUpdateTasksTool: MCPTool = { name: 'bulk_update_tasks', description: 'Update multiple tasks at once', inputSchema: { type: 'object', properties: { task_ids: { type: 'array', items: { type: 'string' }, description: 'Array of task IDs to update' }, updates: { type: 'object', properties: { status: { type: 'string', enum: ['todo', 'in_progress', 'done'] }, priority: { type: 'string', enum: ['low', 'medium', 'high'] }, assignee_id: { type: 'string' }, due_date: { type: 'string', format: 'date-time' } }, description: 'Updates to apply to all tasks' }, cascade_dependencies: { type: 'boolean', default: false, description: 'Whether to update dependent tasks automatically' } }, required: ['task_ids', 'updates'] } }
- src/tools/tasks.ts:1157-1167 (registration)Registration of the bulkUpdateTasks handler in the taskHandlers export object, mapping 'bulk_update_tasks' to the handler 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 }