decide_set_task_due_date
Assign due dates to tasks in the Decide realm using task record names and ISO-formatted end dates, enabling structured task management within the ADD framework.
Instructions
Set due date for a task in Decide realm.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endDate | Yes | Due date in ISO format | |
| taskRecordName | Yes | Record name of the task |
Implementation Reference
- src/index.ts:1018-1036 (handler)Main handler for 'decide_set_task_due_date' tool. Validates task is in Decide realm (ID 2), ensures due date is in the future, then calls setDueDateForItem to update.private async setTaskDueDate(taskRecordName: string, endDate: string) { // Validate that task is in Decide realm before setting due date const item = await this.mockFetchItem(taskRecordName, 'Task'); if (!item) { throw new McpError(ErrorCode.InvalidParams, `Task ${taskRecordName} not found`); } if (item.realmId !== REALM_DECIDE_ID) { throw new McpError(ErrorCode.InvalidParams, `Task ${taskRecordName} must be in Decide realm to set due date. Current realm: ${item.realmId}`); } // Validate due date is in the future const dueDate = new Date(endDate); const now = new Date(); if (dueDate <= now) { throw new McpError(ErrorCode.InvalidParams, `Due date must be in the future. Provided: ${dueDate.toLocaleDateString()}`); } return this.setDueDateForItem(taskRecordName, 'Task', endDate); }
- src/index.ts:453-464 (schema)Input schema definition for the 'decide_set_task_due_date' tool, specifying required taskRecordName and endDate (ISO datetime).{ name: 'decide_set_task_due_date', description: 'Set due date for a task in Decide realm.', inputSchema: { type: 'object', properties: { taskRecordName: { type: 'string', description: 'Record name of the task' }, endDate: { type: 'string', format: 'date-time', description: 'Due date in ISO format' } }, required: ['taskRecordName', 'endDate'] } },
- src/index.ts:712-714 (registration)Tool registration in the CallToolRequestSchema switch statement, dispatching to setTaskDueDate handler after argument validation.case 'decide_set_task_due_date': this.validateArgs(args, ['taskRecordName', 'endDate']); return await this.setTaskDueDate(args.taskRecordName, args.endDate);
- src/index.ts:1000-1005 (helper)Helper function called by the handler to perform the actual due date update (mock implementation returning success message). Used for both tasks and projects.private async setDueDateForItem(itemRecordName: string, itemType: 'Task' | 'Project', endDateISO: string) { // Mock fetch & check realm (should be REALM_DECIDE_ID) const endDateTimestamp = new Date(endDateISO).getTime(); // Mock update: console.log('Mock CloudKit: Setting endDate', endDateTimestamp, 'for', itemType, itemRecordName); return { content: [{ type: 'text', text: `Due date (endDate) ${endDateISO} set for ${itemType} ${itemRecordName} in Decide realm.` }] }; }
- src/index.ts:1020-1021 (helper)Realm validation logic within handler using mockFetchItem to ensure task is in Decide realm before allowing due date assignment.const item = await this.mockFetchItem(taskRecordName, 'Task'); if (!item) {