get_collections
Retrieve all collections from the addTaskManager MCP Server to manage tasks, projects, and ideas using the ADD framework across Assess, Decide, and Do realms.
Instructions
Get all collections.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:587-591 (registration)Tool registration including name, description, and input schema (empty object){ name: 'get_collections', description: 'Get all collections.', inputSchema: { type: 'object', properties: {} } },
- src/index.ts:1381-1411 (handler)Primary MCP tool handler for 'get_collections'. Dispatches to CloudKitService in production mode or returns mock data in development. Formats results as text response.private async getCollections() { return this.withCloudKitOrMock( 'getCollections', async () => { // CloudKit production implementation const collections = await this.cloudKitService.getCollections(); let response = `All collections:\n`; if (collections.length === 0) { response += 'No collections found. Create some to organize your tasks! š'; } else { response += collections.map((collection: any) => { const name = collection.fields?.collectionName?.value || 'Unnamed Collection'; return `- ${name} (${collection.recordName})`; }).join('\n'); } return { content: [{ type: 'text', text: response }] }; }, async () => { // Mock implementation const mockCollections = [ { recordName: 'collection_1', collectionName: 'Work Projects' }, { recordName: 'collection_2', collectionName: 'Personal Goals' }, { recordName: 'collection_3', collectionName: 'Done' } ]; return { content: [{ type: 'text', text: `All collections:\n${mockCollections.map(c => `- ${c.collectionName} (${c.recordName})`).join('\n')}` }] }; } ); }
- src/index.ts:758-759 (handler)Dispatch from MCP CallToolRequestSchema switch statement to the getCollections handler methodreturn await this.getCollections(); case 'get_tasks_by_context':
- CloudKitService helper method queried by MCP handler. Performs sorted query on 'Collections' record type.async getCollections(): Promise<any[]> { return this.queryRecords('Collections', { sortBy: [{ fieldName: 'collectionName', ascending: true }] }); }
- src/index.ts:165-179 (schema)TypeScript interface defining the structure of Collection records from CloudKit/CoreData model.interface ZenTaskticCollection { recordName?: string; recordType: 'Collections'; fields: { collectionName: { value: string }; // Collection name uniqueId: { value: string }; // UUID, max 58 chars creationDate?: { value: number }; // Timestamp lastModified: { value: number }; // Timestamp // References (relationships in Core Data) ideas?: { value: CKReference[] }; // List of references to Ideas records projects?: { value: CKReference[] }; // List of references to Projects records tasks?: { value: CKReference[] }; // List of references to Task records }; }