moveToRealm
Transfer tasks or projects to specified realms within the ADD framework—Assess, Decide, or Do—to align with workflow stages using addTaskManager MCP Server.
Instructions
Move a task or project to a specific realm.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemRecordName | Yes | Record name of the task or project to move | |
| itemType | Yes | Type of item to move | |
| realmId | Yes | Target realm (assess=1, decide=2, do=3) |
Implementation Reference
- src/index.ts:574-586 (registration)Registration of the moveToRealm tool in ListTools response, including full input schema definition.{ name: 'moveToRealm', description: 'Move a task or project to a specific realm.', inputSchema: { type: 'object', properties: { itemRecordName: { type: 'string', description: 'Record name of the task or project to move' }, itemType: { type: 'string', enum: ['Task', 'Project'], description: 'Type of item to move' }, realmId: { type: 'string', enum: ['assess', 'decide', 'do'], description: 'Target realm (assess=1, decide=2, do=3)' } }, required: ['itemRecordName', 'itemType', 'realmId'] } },
- src/index.ts:748-756 (handler)Primary dispatch handler for moveToRealm tool execution in CallToolRequestSchema switch statement. Validates input and routes to task or project mover.case 'moveToRealm': this.validateArgs(args, ['itemRecordName', 'itemType', 'realmId']); if (args.itemType === 'Task') { return await this.moveTaskToRealm(args.itemRecordName, args.realmId); } else if (args.itemType === 'Project') { return await this.moveProjectToRealm(args.itemRecordName, args.realmId); } else { throw new McpError(ErrorCode.InvalidParams, 'itemType must be Task or Project'); }
- src/index.ts:1042-1049 (handler)Handler for moving tasks to a target realm: performs ADD framework validation then delegates to core move logic.private async moveTaskToRealm(taskRecordName: string, targetRealm: string) { // Add validation before moving const validationResult = await this.validateRealmTransition(taskRecordName, 'Task', targetRealm as RealmString); if (!validationResult.valid) { throw new McpError(ErrorCode.InvalidParams, validationResult.reason); } return this.moveItemToRealm(taskRecordName, 'Task', targetRealm as RealmString); }
- src/index.ts:1051-1058 (handler)Handler for moving projects to a target realm: performs ADD framework validation then delegates to core move logic.private async moveProjectToRealm(projectRecordName: string, targetRealm: string) { // Add validation before moving const validationResult = await this.validateRealmTransition(projectRecordName, 'Project', targetRealm as RealmString); if (!validationResult.valid) { throw new McpError(ErrorCode.InvalidParams, validationResult.reason); } return this.moveItemToRealm(projectRecordName, 'Project', targetRealm as RealmString); }
- src/index.ts:1200-1214 (handler)Core implementation of realm move: updates realmId, applies realm-specific field cleanup rules, and returns confirmation (mock for development; delegates to CloudKitService in production).private async moveItemToRealm(itemRecordName: string, itemType: 'Task' | 'Project', targetRealmStr: RealmString) { const targetRealmId = realmStringToId(targetRealmStr); // Mock update realmId and clean up fields based on realm rules let updateMessage = `${itemType} ${itemRecordName} moved to ${targetRealmStr} realm (ID: ${targetRealmId})`; // Apply realm-specific cleanup rules if (targetRealmId === REALM_ASSESS_ID) { updateMessage += '. Context and due date cleared for fresh evaluation'; } else if (targetRealmId === REALM_DECIDE_ID && targetRealmStr !== 'decide') { updateMessage += '. Ready for context assignment and due date setting'; } return { content: [{ type: 'text', text: updateMessage }] }; }