get_tasks_by_realm
Filter and retrieve tasks in the addTaskManager app based on specific realms: Assess, Decide, or Do. Streamline task management by organizing work according to the ADD framework.
Instructions
Filter tasks by realm.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| realm | Yes | Realm to query (maps to realmId 1, 2, or 3) |
Implementation Reference
- src/index.ts:548-557 (schema)Input schema definition for the 'get_tasks_by_realm' tool, specifying the 'realm' parameter.name: 'get_tasks_by_realm', description: 'Filter tasks by realm.', inputSchema: { type: 'object', properties: { realm: { type: 'string', enum: ['assess', 'decide', 'do'], description: 'Realm to query (maps to realmId 1, 2, or 3)' } }, required: ['realm'] } },
- src/index.ts:740-742 (registration)Tool registration and dispatch in the CallToolRequestSchema handler switch statement.case 'get_tasks_by_realm': this.validateArgs(args, ['realm']); return await this.getTasksByRealm(args.realm as RealmString);
- src/index.ts:1446-1450 (handler)Primary handler function for executing the 'get_tasks_by_realm' tool (mock implementation).private async getTasksByRealm(realm: RealmString) { const realmId = realmStringToId(realm); const mockTasks = [{ recordName: 'task_123', taskName: 'Sample Task A', realmId }]; return { content: [{ type: 'text', text: `Tasks in ${realm} realm (ID: ${realmId}):\n${mockTasks.map(t => `- ${t.taskName} (${t.recordName})`).join('\n')}` }] }; }
- CloudKitService helper method providing the actual database query implementation for tasks by realm (used in production by other tools).async getTasksByRealm(realmId: number): Promise<ZenTaskticTask[]> { return this.queryRecords<ZenTaskticTask>('Task', { filterBy: [{ fieldName: 'realmId', fieldValue: realmId, comparator: 'EQUALS' }], sortBy: [{ fieldName: 'lastModified', ascending: false }] }); }
- src/index.ts:36-41 (helper)Utility function to map realm string ('assess', 'decide', 'do') to numeric realmId (1,2,3).const realmStringToId = (realmStr: RealmString): number => { if (realmStr === 'assess') return REALM_ASSESS_ID; if (realmStr === 'decide') return REALM_DECIDE_ID; if (realmStr === 'do') return REALM_DO_ID; throw new McpError(ErrorCode.InvalidParams, `Invalid realm string: ${realmStr}`); };