move_tasks
Move Todoist tasks to different projects, sections, or parent tasks to reorganize your workflow.
Instructions
Move tasks to a different parent or section in Todoist. Exactly one of parent_id, section_id, or project_id must be provided
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes |
Implementation Reference
- src/tools/tasks.ts:186-234 (handler)Full implementation of the 'move_tasks' tool. Registers the tool with createSyncApiHandler, defines input schema, description, and custom handler logic via buildCommandArgs (constructs Todoist sync command for moving task) and validateItem (ensures exactly one destination). Uses Todoist sync API with commandType 'item_move'.createSyncApiHandler({ name: 'move_tasks', description: 'Move tasks to a different parent or section in Todoist. Exactly one of parent_id, section_id, or project_id must be provided', itemSchema: { task_id: z.string().optional(), task_name: z.string().optional(), parent_id: z.string().optional(), section_id: z.string().optional(), project_id: z.string().optional(), }, commandType: 'item_move', idField: 'task_id', nameField: 'task_name', lookupPath: '/tasks', findByName: (name, items) => items.find(item => item.content && item.content.toLowerCase().includes(name.toLowerCase())), buildCommandArgs: (item, itemId) => { const args: { id: string; parent_id?: string; section_id?: string; project_id?: string; } = { id: itemId }; // Only one destination option if (item.parent_id) args.parent_id = item.parent_id; else if (item.section_id) args.section_id = item.section_id; else if (item.project_id) args.project_id = item.project_id; return args; }, validateItem: item => { // Ensure exactly one destination is specified const destinationCount = [item.parent_id, item.section_id, item.project_id].filter( Boolean ).length; if (destinationCount !== 1) { return { valid: false, error: 'Exactly one of parent_id, section_id, or project_id must be provided', }; } return { valid: true }; }, });