list_archived_requests
Retrieve and filter archived task requests with metadata and completion details in TaskFlow MCP. Search by text or ID to review past completed work.
Instructions
List archived requests with optional search and filtering capabilities.
Provides an overview of all archived requests with their metadata and completion information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| searchTerm | No | Optional search term to filter archived requests by request text or ID | |
| limit | No | Optional limit on the number of results to return |
Implementation Reference
- src/tools/TaskFlowTools.ts:669-672 (handler)The MCP tool handler function that extracts searchTerm and limit from arguments and delegates to TaskFlowService.listArchivedRequests.async list_archived_requests(args: any) { const { searchTerm, limit } = args ?? {}; return service.listArchivedRequests(searchTerm, limit); },
- src/tools/TaskFlowTools.ts:509-527 (schema)Defines the tool's metadata (name, description) and input schema for validation.export const LIST_ARCHIVED_REQUESTS_TOOL: Tool = { name: "list_archived_requests", description: "List archived requests with optional search and filtering capabilities.\n\n" + "Provides an overview of all archived requests with their metadata and completion information.", inputSchema: { type: "object", properties: { searchTerm: { type: "string", description: "Optional search term to filter archived requests by request text or ID" }, limit: { type: "number", description: "Optional limit on the number of results to return" }, }, }, };
- src/server/TaskFlowServer.ts:42-45 (registration)Instantiates the handlers object from taskflowHandlers(service), which includes the list_archived_requests handler, binding it to the service instance.constructor(service: TaskFlowService) { this.service = service; this.handlers = taskflowHandlers(service);
- src/server/TaskFlowServer.ts:86-88 (registration)Includes LIST_ARCHIVED_REQUESTS_TOOL in the tools list returned by ListToolsRequestHandler for tool discovery.ARCHIVE_COMPLETED_REQUESTS_TOOL, LIST_ARCHIVED_REQUESTS_TOOL, RESTORE_ARCHIVED_REQUEST_TOOL,
- Implements the core logic: loads the archive file, applies optional search filtering and limit, maps to response format.public async listArchivedRequests(searchTerm?: string, limit?: number) { const archive = await this.loadArchive(); let archivedRequests = archive.archivedRequests; if (searchTerm) { archivedRequests = archivedRequests.filter(req => req.originalRequest.toLowerCase().includes(searchTerm.toLowerCase()) || req.originalRequestId.toLowerCase().includes(searchTerm.toLowerCase()) ); } if (limit && limit > 0) { archivedRequests = archivedRequests.slice(0, limit); } return { status: "archived_requests_listed", archivedRequests: archivedRequests.map(req => ({ requestId: req.originalRequestId, originalRequest: req.originalRequest, tasksCount: req.tasks.length, completedAt: req.completedAt, archivedAt: req.archivedAt })), archiveInfo: archive.archiveInfo, message: `Found ${archivedRequests.length} archived request(s).` }; }