sonarr_get_queue
Retrieve the current download queue from Sonarr to monitor pending TV show episodes and track download progress.
Instructions
Get Sonarr download queue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:206-214 (registration)Registers the 'sonarr_get_queue' tool in the TOOLS array if Sonarr client is configured. Defines input schema as empty object.{ name: "sonarr_get_queue", description: "Get Sonarr download queue", inputSchema: { type: "object" as const, properties: {}, required: [], }, },
- src/index.ts:1101-1119 (handler)MCP tool handler for 'sonarr_get_queue'. Fetches queue from SonarrClient, formats progress and returns as JSON text content.case "sonarr_get_queue": { if (!clients.sonarr) throw new Error("Sonarr not configured"); const queue = await clients.sonarr.getQueue(); return { content: [{ type: "text", text: JSON.stringify({ totalRecords: queue.totalRecords, items: queue.records.map(q => ({ title: q.title, status: q.status, progress: ((1 - q.sizeleft / q.size) * 100).toFixed(1) + '%', timeLeft: q.timeleft, downloadClient: q.downloadClient, })), }, null, 2), }], }; }
- src/arr-client.ts:492-494 (handler)Core implementation in ArrClient.getQueue(), called by SonarrClient. Makes API request to /queue endpoint with parameters for unknown items.async getQueue(): Promise<{ records: QueueItem[]; totalRecords: number }> { return this.request<{ records: QueueItem[]; totalRecords: number }>('/queue?includeUnknownSeriesItems=true&includeUnknownMovieItems=true'); }
- src/arr-client.ts:32-47 (schema)TypeScript interface defining the QueueItem returned by the Sonarr /queue API.export interface QueueItem { id: number; title: string; status: string; trackedDownloadStatus: string; trackedDownloadState: string; statusMessages: Array<{ title: string; messages: string[] }>; downloadId: string; protocol: string; downloadClient: string; outputPath: string; sizeleft: number; size: number; timeleft: string; estimatedCompletionTime: string; }