download_status
Check download progress and status across multiple media management services and download clients to monitor media acquisition workflows.
Instructions
Get unified download status across arr services and downloaders
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| downloader | No | ||
| includeDownloader | No | ||
| services | No |
Implementation Reference
- src/index.ts:427-533 (handler)The primary handler function that implements the download_status tool. It aggregates queue status from multiple arr services and optionally a downloader (e.g., SABnzbd), computes totals for queued, downloading, and pending items, and returns a unified status report.private async runDownloadStatus(input: { services?: string[]; includeDownloader?: boolean; downloader?: string; }) { const targetServices = input.services || serviceRegistry.getAllNames(); const includeDownloaderFlag = input.includeDownloader ?? true; const downloaderName = input.downloader || Object.keys(this.config?.downloaders || {})[0]; const serviceResults = []; let totalQueued = 0; let totalDownloading = 0; let totalCompletedPendingImport = 0; // Get arr service data for (const serviceName of targetServices) { const service = serviceRegistry.get(serviceName); if (!service) continue; try { const queueResult = await service.queueList(); if (queueResult.ok && queueResult.data) { const queueData = queueResult.data; const downloading = queueData.items.filter( (item) => item.status.toLowerCase().includes("downloading") || item.status.toLowerCase().includes("grabbing"), ).length; const pending = queueData.items.filter( (item) => item.status.toLowerCase().includes("completed") || item.status.toLowerCase().includes("pending"), ).length; serviceResults.push({ service: serviceName, mediaKind: queueData.mediaKind, total: queueData.total, downloading, pending, }); totalQueued += queueData.total; totalDownloading += downloading; totalCompletedPendingImport += pending; } } catch (error) { console.error(`Failed to get queue data for ${serviceName}:`, error); } } let downloaderData = null; if (includeDownloaderFlag && downloaderName) { const downloader = serviceRegistry.getDownloader(downloaderName); if (downloader) { try { const [statusResult, queueResult] = await Promise.all([ downloader.serverStats(), downloader.queueList(), ]); if ( statusResult.ok && queueResult.ok && statusResult.data && queueResult.data ) { downloaderData = { service: downloaderName, name: statusResult.data.name, version: statusResult.data.version, isHealthy: statusResult.data.isHealthy, paused: statusResult.data.paused, totalSlots: queueResult.data.total, speedKBps: queueResult.data.speedKBps, totalSizeMB: queueResult.data.totalSizeMB, remainingSizeMB: queueResult.data.remainingSizeMB, items: queueResult.data.items.length, }; } } catch (error) { console.error( `Failed to get downloader data for ${downloaderName}:`, error, ); } } } return { ok: true, data: { services: targetServices, totals: { queued: totalQueued, downloading: totalDownloading, completedPendingImport: totalCompletedPendingImport, }, serviceResults, downloader: downloaderData, correlationRatio: downloaderData ? Math.min(1.0, totalQueued / Math.max(1, downloaderData.items)) : null, }, }; }
- src/index.ts:157-170 (schema)The tool schema definition for download_status, including name, description, and inputSchema specifying optional parameters for services, includeDownloader, and downloader.{ name: "download_status", description: "Get unified download status across arr services and downloaders", inputSchema: { type: "object", properties: { services: { type: "array", items: { type: "string" } }, includeDownloader: { type: "boolean" }, downloader: { type: "string" }, }, required: [], }, },
- src/index.ts:257-260 (registration)The dispatch/registration point in the main CallToolRequestSchema handler where download_status tool calls are routed to the runDownloadStatus method.} else if (name === "download_status") { result = await debugToolTiming(name, "multi", () => this.runDownloadStatus(input), );