moveToRealm
Transfer tasks or projects between ADD framework realms (Assess, Decide, Do) to manage workflow stages and enforce realm-specific actions like editing, scheduling, or completion.
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:575-586 (schema)Schema definition for the moveToRealm tool, including input parameters and description. Part of the tools list returned by listTools.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:750-758 (handler)Main handler for moveToRealm tool in the CallToolRequestSchema switch statement. Validates args and dispatches to task/project specific move functions.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'); } case 'get_collections': return await this.getCollections();
- src/index.ts:1042-1049 (helper)Task-specific handler that validates realm transition before calling generic moveItemToRealm.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 (helper)Project-specific handler that validates realm transition before calling generic moveItemToRealm.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 logic for moving an item to a target realm, including realm-specific message and mock update.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 }] }; }