assess_create_task
Create a new task in the Assess realm for content editing, specifying task name, optional priority, and parent project or collection. Integrates with addTaskManager for structured task management.
Instructions
Create a new task in Assess realm (content editing, no contexts/dates).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionRecordName | No | Optional recordName of the parent collection. | |
| projectRecordName | No | Optional recordName of the parent project. | |
| startDate | No | Optional start date (ISO format) | |
| taskName | Yes | Task name/description (max 1000 chars) | |
| taskPriority | No | Optional task priority (1-5, default 3) |
Implementation Reference
- src/index.ts:255-268 (registration)Registration and schema definition of the 'assess_create_task' tool in the list of available tools, including input schema validation.name: 'assess_create_task', description: 'Create a new task in Assess realm (content editing, no contexts/dates).', inputSchema: { type: 'object', properties: { taskName: { type: 'string', description: 'Task name/description (max 1000 chars)' }, startDate: { type: 'string', format: 'date-time', description: 'Optional start date (ISO format)' }, taskPriority: { type: 'integer', minimum: 1, maximum: 5, description: 'Optional task priority (1-5, default 3)'}, projectRecordName: { type: 'string', description: 'Optional recordName of the parent project.' }, collectionRecordName: { type: 'string', description: 'Optional recordName of the parent collection.' } }, required: ['taskName'] } },
- src/index.ts:918-937 (handler)The core handler function that implements the tool logic: constructs a CloudKit-compatible ZenTaskticTask record for the Assess realm (realmId=1), generates UUIDs, sets appropriate fields while respecting realm rules (no context/due date), and returns success message. In production, would integrate with CloudKitService.saveRecord.private async createTask(taskName: string, startDateISO?: string, taskPriority: number = 3, projectRecordName?: string, collectionRecordName?: string) { const now = Date.now(); const taskRecordName = `task_ck_${uuidv4()}`; const task: ZenTaskticTask = { recordType: 'Task', recordName: taskRecordName, fields: { taskName: { value: taskName }, realmId: { value: REALM_ASSESS_ID }, uniqueId: { value: uuidv4() }, startDate: { value: startDateISO ? new Date(startDateISO).getTime() : now }, lastModified: { value: now }, taskPriority: { value: taskPriority }, ...(projectRecordName && { project: { value: { recordName: projectRecordName, action: 'NONE' } } }), ...(collectionRecordName && { collection: { value: { recordName: collectionRecordName, action: 'NONE' } } }), } }; // Mock save: console.log('Mock CloudKit: Creating Task', task); return { content: [{ type: 'text', text: `Task "${taskName}" created in Assess realm with ID ${taskRecordName}.` }] }; }
- src/index.ts:660-662 (registration)Tool dispatch/registration in the MCP CallToolRequestSchema handler switch statement, which validates input args and invokes the createTask handler.this.validateArgs(args, ['taskName']); return await this.createTask(args.taskName, args.startDate, args.taskPriority, args.projectRecordName, args.collectionRecordName); case 'assess_edit_task':
- src/index.ts:73-108 (schema)TypeScript interface definition for ZenTaskticTask records used in CloudKit operations, defining the structure validated and used by the assess_create_task handler.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 }; }