get_undecided_items_in_decide
Identify unresolved tasks and projects within the Decide realm to streamline prioritization and improve task management efficiency.
Instructions
Find undecided items (tasks + projects) in Decide realm.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:608-612 (registration)Tool registration including name, description, and input schema (empty object since no params). Part of the static tools list returned by listTools handler.{ name: 'get_undecided_items_in_decide', description: 'Find undecided items (tasks + projects) in Decide realm.', inputSchema: { type: 'object', properties: {} } },
- src/index.ts:1533-1615 (handler)Primary handler method that executes the tool. Dispatches to production CloudKit queries via CloudKitService or returns formatted mock data for undecided items (Decide realm tasks/projects lacking context or due date).private async getUndecidedItemsInDecide() { return this.withCloudKitOrMock( 'getUndecidedItemsInDecide', async () => { // CloudKit production implementation const [undecidedTasks, allProjects] = await Promise.all([ this.cloudKitService.getTasksInDecideUndecided(), this.cloudKitService.getProjectsByRealm(2) ]); // Filter projects that lack context or due date const undecidedProjects = allProjects.filter((project: any) => { const hasContext = project.fields?.context?.value?.recordName; const hasEndDate = project.fields?.endDate?.value; return !hasContext || !hasEndDate; }); const allUndecidedItems = [...undecidedTasks, ...undecidedProjects]; let response = `Undecided items in Decide realm (need context/timeline decisions):\n`; if (allUndecidedItems.length === 0) { response += 'All items in Decide realm have context and due dates set! ✅'; } else { response += allUndecidedItems.map(item => { const isTask = item.recordType === 'Task'; const name = isTask ? item.fields?.taskName?.value : item.fields?.projectName?.value; const hasContext = item.fields?.context?.value?.recordName; const hasEndDate = item.fields?.endDate?.value; const type = isTask ? 'Task' : 'Project'; const missing = []; if (!hasContext) missing.push('context'); if (!hasEndDate) missing.push('due date'); return `- ${name} (${item.recordName}) - needs: ${missing.join(' + ')} [${type}]`; }).join('\n'); } return { content: [{ type: 'text', text: response }] }; }, async () => { // Mock implementation const mockItems = [ { recordName: 'task_undecided_1', taskName: 'Research new marketing strategy', contextRecordName: null, endDate: null, realmId: 2, needsDecision: 'Context and timeline' }, { recordName: 'task_undecided_2', taskName: 'Call insurance company', contextRecordName: 'context_home', endDate: null, realmId: 2, needsDecision: 'Due date scheduling' }, { recordName: 'project_undecided_1', projectName: 'Organize home office', contextRecordName: null, endDate: null, realmId: 2, needsDecision: 'Context and timeline' } ]; let response = `Undecided items in Decide realm (need context/timeline decisions):\n`; response += mockItems.map(item => { const type = item.recordName.startsWith('task_') ? 'Task' : 'Project'; const name = item.taskName || (item as any).projectName; const missing = []; if (!item.contextRecordName) missing.push('context'); if (!item.endDate) missing.push('due date'); return `- ${name} (${item.recordName}) - needs: ${missing.join(' + ')}`; }).join('\n'); return { content: [{ type: 'text', text: response }] }; } ); }
- src/index.ts:765-765 (registration)Dispatch case in the CallToolRequestSchema handler that routes tool calls to the specific handler method.return await this.getUndecidedItemsInDecide();
- Helper method in CloudKitService used by production handler to fetch undecided tasks in Decide realm (no context OR no endDate) by combining two CloudKit queries and deduplicating.async getTasksInDecideUndecided(): Promise<ZenTaskticTask[]> { // CloudKit doesn't support complex OR conditions directly // We'll need to make two queries and combine results const [noContext, noDueDate] = await Promise.all([ // Tasks with no context this.queryRecords<ZenTaskticTask>('Task', { filterBy: [ { fieldName: 'realmId', fieldValue: 2, comparator: 'EQUALS' }, { fieldName: 'contextRecordName', fieldValue: null, comparator: 'EQUALS' } ] }), // Tasks with no due date this.queryRecords<ZenTaskticTask>('Task', { filterBy: [ { fieldName: 'realmId', fieldValue: 2, comparator: 'EQUALS' }, { fieldName: 'endDate', fieldValue: null, comparator: 'EQUALS' } ] }) ]); // Combine and deduplicate by recordName const combined = [...noContext, ...noDueDate]; const uniqueRecords = new Map(); combined.forEach(task => { uniqueRecords.set((task as any).recordName, task); }); return Array.from(uniqueRecords.values()); }
- Helper method called by handler to fetch all projects in Decide realm (realmId=2), which are then client-side filtered for undecided ones.async getProjectsByRealm(realmId: number): Promise<ZenTaskticProject[]> { return this.queryRecords<ZenTaskticProject>('Projects', { filterBy: [{ fieldName: 'realmId', fieldValue: realmId, comparator: 'EQUALS' }], sortBy: [{ fieldName: 'lastModified', ascending: false }] }); }