restore_archived_request
Restore archived requests to active status in TaskFlow MCP, allowing continued work on previously archived tasks by moving them back to the active tasks file.
Instructions
Restore a specific archived request back to the active tasks file.
This moves the request from the archive back to active status, allowing you to continue working on it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | The ID of the archived request to restore |
Implementation Reference
- src/tools/TaskFlowTools.ts:674-677 (handler)The main handler function for the 'restore_archived_request' tool. It extracts the requestId from args and delegates to the TaskFlowService.restoreArchivedRequest method.
async restore_archived_request(args: any) { const { requestId } = args ?? {}; return service.restoreArchivedRequest(String(requestId)); }, - src/tools/TaskFlowTools.ts:529-544 (schema)Tool schema definition including name, description, and inputSchema requiring 'requestId'.
export const RESTORE_ARCHIVED_REQUEST_TOOL: Tool = { name: "restore_archived_request", description: "Restore a specific archived request back to the active tasks file.\n\n" + "This moves the request from the archive back to active status, allowing you to continue working on it.", inputSchema: { type: "object", properties: { requestId: { type: "string", description: "The ID of the archived request to restore" }, }, required: ["requestId"], }, }; - src/server/TaskFlowServer.ts:88-89 (registration)The tool is registered in the server's list of tools returned by ListToolsRequestSchema handler.
RESTORE_ARCHIVED_REQUEST_TOOL, ], - The core service method that implements the restoration logic: loads archive and tasks, finds the archived request, validates, converts to active format (sets completed=false), adds to active tasks, removes from archive, and saves both files.
public async restoreArchivedRequest(requestId: string) { const archive = await this.loadArchive(); await this.loadTasks(); const archivedIndex = archive.archivedRequests.findIndex(req => req.originalRequestId === requestId); if (archivedIndex === -1) { return { status: "error", message: `Archived request with ID ${requestId} not found.` }; } const archivedRequest = archive.archivedRequests[archivedIndex]; // Check if request ID already exists in active tasks if (this.data.requests.some(req => req.requestId === requestId)) { return { status: "error", message: `Request with ID ${requestId} already exists in active tasks.` }; } // Convert back to active request format const restoredRequest: RequestEntry = { requestId: archivedRequest.originalRequestId, originalRequest: archivedRequest.originalRequest, splitDetails: archivedRequest.splitDetails, tasks: archivedRequest.tasks, completed: false, // Mark as not completed when restored dependencies: archivedRequest.dependencies, notes: archivedRequest.notes }; // Add to active tasks and remove from archive this.data.requests.push(restoredRequest); archive.archivedRequests.splice(archivedIndex, 1); archive.archiveInfo.totalArchivedRequests = archive.archivedRequests.length; await this.saveTasks(); await this.saveArchive(archive); return { status: "request_restored", restoredRequest: { requestId: restoredRequest.requestId, originalRequest: restoredRequest.originalRequest, tasksCount: restoredRequest.tasks.length }, message: `Request ${requestId} has been restored from archive.` }; }