bulk_update_tasks
Update multiple tasks simultaneously by modifying status, priority, assignee, or due date across 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 for the bulk_update_tasks tool. It validates input using Zod schema, iterates over task_ids applying the updates to each task via supabaseService.updateTask, optionally handles cascading completion of dependencies, and returns a summary of successful/failed updates.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 in the bulkUpdateTasks handler, defining task_ids array, updates object, and cascade_dependencies boolean.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 the tool name, description, and JSON Schema for inputs. This is exported and included in taskTools export.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)Export of taskHandlers object mapping tool names to their handler functions, including bulk_update_tasks: bulkUpdateTasks. This registers the handler for the MCP system.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/tools/tasks.ts:1036-1057 (helper)Helper function called during bulk updates when cascade_dependencies is true and status is set to 'done'. It unblocks dependent tasks if all their blocking dependencies are completed.async function handleTaskCompletion(taskId: string): Promise<void> { // Get dependent tasks const dependencies = await supabaseService.getTaskDependencies(taskId) const dependentTasks = dependencies.filter(d => d.depends_on_task_id === taskId) // Update dependent tasks that are no longer blocked for (const dep of dependentTasks) { const otherDeps = await supabaseService.getTaskDependencies(dep.task_id) const stillBlocked = otherDeps.some(d => d.depends_on_task_id !== taskId && d.dependency_type === 'blocks' && d.depends_on_task?.status !== 'done' ) if (!stillBlocked && dep.task?.status === 'blocked') { await supabaseService.updateTask(dep.task_id, { status: 'todo', updated_at: new Date().toISOString() }) } } }