do_mark_task_as_done
Mark tasks as completed in the Do realm of the ADD framework to track progress and manage workflow.
Instructions
Mark tasks as completed in Do realm.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskRecordName | Yes | Task record name |
Implementation Reference
- src/index.ts:523-534 (registration)Tool registration in ListToolsRequestSchema handler, including name, description, and input schema definition.
{ name: 'do_mark_task_as_done', description: 'Mark tasks as completed in Do realm.', inputSchema: { type: 'object', properties: { taskRecordName: { type: 'string', description: 'Task record name' } }, required: ['taskRecordName'] } }, { - src/index.ts:732-734 (registration)Tool dispatch in CallToolRequestSchema switch statement, validating arguments and calling the handler.
case 'do_mark_task_as_done': this.validateArgs(args, ['taskRecordName']); return await this.markTaskAsDone(args.taskRecordName); - src/index.ts:1415-1428 (handler)The handler function that implements the tool logic. Validates the task is in Do realm (3), then mocks completion by returning a success message indicating endDate set and moved to realm 4 (Done).
private async markTaskAsDone(taskRecordName: string) { // Validate that task is in Do realm before marking as done const item = await this.mockFetchItem(taskRecordName, 'Task'); if (!item) { throw new McpError(ErrorCode.InvalidParams, `Task ${taskRecordName} not found`); } if (item.realmId !== REALM_DO_ID) { throw new McpError(ErrorCode.InvalidParams, `Task ${taskRecordName} must be in Do realm to mark as done. Current realm: ${item.realmId}. Move to Do realm first.`); } const completionTime = new Date().toISOString(); // Mock marking task as done via CloudKit - this would set realmId to 4 (Done) and move to Done collection return { content: [{ type: 'text', text: `Task ${taskRecordName} marked as done at ${completionTime}. Moved to Done collection (realm 4).` }] }; }