get_tasks_overdue_in_do
Retrieve overdue tasks from the Do realm in the ADD framework to identify items requiring immediate completion.
Instructions
Find tasks overdue in Do realm.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1913-1981 (handler)MCP tool handler for 'get_tasks_overdue_in_do'. Delegates to CloudKitService in production or returns mock overdue tasks. Formats response with task details, overdue days, context, and priority.private async getTasksOverdueInDo() { return this.withCloudKitOrMock( 'getTasksOverdueInDo', async () => { // CloudKit production implementation const overdueTasks = await this.cloudKitService.getTasksInDoOverdue(); let response = `Overdue items in Do realm (past due dates - need immediate attention):\n`; if (overdueTasks.length === 0) { response += 'No overdue tasks in Do realm! š Great job staying on track!'; } else { response += overdueTasks.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'; const endDate = task.fields?.endDate?.value; const overdueDays = Math.ceil((Date.now() - new Date(endDate).getTime()) / (24 * 60 * 60 * 1000)); const urgency = overdueDays > 3 ? 'ā ļø URGENT' : 'ā Overdue'; return `- ${urgency} ${name} (${task.recordName}) - ${overdueDays} day${overdueDays > 1 ? 's' : ''} overdue - ${contextName} - ${priorityIcon}`; }).join('\n'); } return { content: [{ type: 'text', text: response }] }; }, async () => { // Mock implementation const now = new Date(); const yesterday = new Date(now.getTime() - 86400000); const weekAgo = new Date(now.getTime() - 7 * 86400000); const mockTasks = [ { recordName: 'task_overdue_1', taskName: 'Submit expense report', realmId: 3, endDate: yesterday.toISOString().split('T')[0], contextRecordName: 'context_work', priority: 1, daysOverdue: 1 }, { recordName: 'project_overdue_1', projectName: 'Clean garage', realmId: 3, endDate: weekAgo.toISOString().split('T')[0], contextRecordName: 'context_home', priority: 3, daysOverdue: 7 } ]; let response = `Overdue items in Do realm (past due dates - need immediate attention):\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'; const overdueDays = item.daysOverdue; const urgency = overdueDays > 3 ? 'ā ļø URGENT' : 'ā Overdue'; return `- ${urgency} ${name} (${item.recordName}) - ${overdueDays} day${overdueDays > 1 ? 's' : ''} overdue - ${contextName} - ${priority}`; }).join('\n'); return { content: [{ type: 'text', text: response }] }; } ); }
- Core implementation: CloudKit query for Tasks in Do realm (realmId=3) with endDate < now, sorted by endDate ascending (most overdue first).async getTasksInDoOverdue(): Promise<ZenTaskticTask[]> { const now = new Date().getTime(); return this.queryRecords<ZenTaskticTask>('Task', { filterBy: [ { fieldName: 'realmId', fieldValue: 3, comparator: 'EQUALS' }, { fieldName: 'endDate', fieldValue: now, comparator: 'LESS_THAN' } ], sortBy: [{ fieldName: 'endDate', ascending: true }] // Most overdue first }); }
- src/index.ts:775-776 (registration)Tool registration in CallToolRequestSchema switch statement, dispatching to handler.return await this.getTasksOverdueInDo();
- src/index.ts:634-637 (registration)Tool registration/declaration in ListToolsRequestSchema response, including schema (no input params).name: 'get_tasks_overdue_in_do', description: 'Find tasks overdue in Do realm.', inputSchema: { type: 'object', properties: {} } }
- src/index.ts:637-637 (schema)Input schema for the tool: empty object (no parameters required).}