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:207-214 (registration)Registration of the sonarr_get_queue tool in the TOOLS array, including name, description, and empty input schemaname: "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: checks configuration, calls SonarrClient.getQueue(), formats response with progress and returns as JSON textcase "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 handler in ArrClient.getQueue(): Makes API request to /queue endpoint with parameters to include unknown itemsasync getQueue(): Promise<{ records: QueueItem[]; totalRecords: number }> { return this.request<{ records: QueueItem[]; totalRecords: number }>('/queue?includeUnknownSeriesItems=true&includeUnknownMovieItems=true'); }
- src/arr-client.ts:592-595 (helper)SonarrClient class definition that inherits ArrClient methods including getQueue()export class SonarrClient extends ArrClient { constructor(config: ArrConfig) { super('sonarr', config); }