get_tasks_tomorrow_in_do
Retrieve tasks scheduled for tomorrow within the Do realm of the ADD framework, helping users focus on upcoming actionable items.
Instructions
Find tasks due tomorrow in Do realm.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:624-627 (registration)Tool registration in the ListToolsRequestSchema handler, defining the tool name, description, and empty input schema.name: 'get_tasks_tomorrow_in_do', description: 'Find tasks due tomorrow in Do realm.', inputSchema: { type: 'object', properties: {} } },
- src/index.ts:1778-1840 (handler)Primary MCP tool handler that either delegates to CloudKitService for production queries or returns formatted mock data listing tasks due tomorrow in the Do realm.private async getTasksTomorrowInDo() { return this.withCloudKitOrMock( 'getTasksTomorrowInDo', async () => { // CloudKit production implementation const tomorrowsTasks = await this.cloudKitService.getTasksInDoTomorrow(); let response = `Tomorrow's items in Do realm (due: ${new Date(Date.now() + 86400000).toLocaleDateString()}):\n`; if (tomorrowsTasks.length === 0) { response += 'No tasks scheduled for tomorrow in Do realm! š '; } else { response += tomorrowsTasks.map((task: any) => { const name = task.fields?.taskName?.value || 'Unnamed Task'; const contextRecordName = task.fields?.context?.value?.recordName; const contextName = contextRecordName?.replace('context_', '') || 'No context'; const priority = task.fields?.taskPriority?.value || 3; const priorityIcon = priority === 1 ? 'š“ High' : priority === 2 ? 'š” Medium' : 'š¢ Low'; return `- ${name} (${task.recordName}) - ${contextName} - ${priorityIcon}`; }).join('\n'); } return { content: [{ type: 'text', text: response }] }; }, async () => { // Mock implementation const tomorrow = new Date(Date.now() + 86400000); const tomorrowStr = tomorrow.toISOString().split('T')[0]; const mockTasks = [ { recordName: 'task_tomorrow_1', taskName: 'Dentist appointment', realmId: 3, endDate: tomorrowStr, contextRecordName: 'context_personal', priority: 1, timeEstimate: '1 hour' }, { recordName: 'task_tomorrow_2', taskName: 'Prepare presentation slides', realmId: 3, endDate: tomorrowStr, contextRecordName: 'context_work', priority: 2, timeEstimate: '3 hours' } ]; let response = `Tomorrow's items in Do realm (due: ${tomorrow.toLocaleDateString()}):\n`; response += mockTasks.map(item => { const type = item.recordName.startsWith('task_') ? 'Task' : 'Project'; const name = item.taskName || (item as any).projectName; const contextName = item.contextRecordName?.replace('context_', '') || 'No context'; const priority = item.priority === 1 ? 'š“ High' : item.priority === 2 ? 'š” Medium' : 'š¢ Low'; return `- ${name} (${item.recordName}) - ${contextName} - ${priority} - ~${item.timeEstimate}`; }).join('\n'); return { content: [{ type: 'text', text: response }] }; } ); }
- src/index.ts:770-771 (registration)Tool dispatch in the CallToolRequestSchema switch statement, routing calls to the handler method.case 'get_tasks_tomorrow_in_do': return await this.getTasksTomorrowInDo();
- Helper method in CloudKitService that performs the actual CloudKit database query for tasks (recordType 'Task') in the Do realm (realmId=3) due specifically tomorrow (endDate within tomorrow's full day).async getTasksInDoTomorrow(): Promise<ZenTaskticTask[]> { const tomorrow = new Date(); tomorrow.setDate(tomorrow.getDate() + 1); const startOfDay = new Date(tomorrow.setHours(0, 0, 0, 0)).getTime(); const endOfDay = new Date(tomorrow.setHours(23, 59, 59, 999)).getTime(); return this.queryRecords<ZenTaskticTask>('Task', { filterBy: [ { fieldName: 'realmId', fieldValue: 3, comparator: 'EQUALS' }, { fieldName: 'endDate', fieldValue: startOfDay, comparator: 'GREATER_THAN_OR_EQUALS' }, { fieldName: 'endDate', fieldValue: endOfDay, comparator: 'LESS_THAN_OR_EQUALS' } ] }); }
- src/index.ts:73-108 (schema)Type definition for ZenTaskticTask used by the CloudKit query to structure task records with fields like realmId and endDate crucial for filtering Do realm tasks due tomorrow.export interface ZenTaskticTask { recordName?: string; // CloudKit record name (UUID string, typically) recordType: 'Task'; fields: { taskName: { value: string }; // Max 1000 chars, combines original title & body realmId: { value: number }; // 1 (Assess), 2 (Decide), 3 (Do) uniqueId: { value: string }; // UUID string, primary key in CoreData model // Core Data model fields taskId?: { value: number }; // Integer 16, default 0 contextId?: { value: number }; // Integer 16, default 0 (legacy field) taskAudioRecordId?: { value: number }; // Integer 16, default 0 taskPictureId?: { value: number }; // Integer 16, default 0 orderInParent?: { value: number }; // Integer 16, default 0 taskPriority?: { value: number }; // Integer 16, 1-5, default 3 // References (relationships in Core Data) context?: { value: CKReference }; // Reference to a Contexts record projects?: { value: CKReference }; // Reference to a Projects record (renamed from project) collection?: { value: CKReference }; // Reference to a Collections record ideas?: { value: CKReference }; // Reference to an Ideas record (if task derived from idea) realms?: { value: CKReference }; // Reference to Realms record // Dates startDate?: { value: number }; // Timestamp (milliseconds since epoch) endDate?: { value: number }; // Timestamp (due date, or completion date) lastModified: { value: number }; // Timestamp // Task-specific fields localNotification?: { value: string }; // Alert date/trigger (max 100 chars) taskParentId?: { value: string }; // UUID string of parent Task/Project/Idea taskParentType?: { value: string }; // 'Task', 'Project', 'Idea' // removed isCompleted, completion handled by setting endDate & potentially realm }; }