sonarr_get_queue
Retrieve the current download queue from Sonarr, with an optional limit on the number of entries returned.
Instructions
Get the current Sonarr download queue
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results to return (default: 200) |
Implementation Reference
- src/arr/mcp-functions.ts:251-281 (handler)The main handler function for the sonarr_get_queue tool. It calls ensureSonarr() to get the client, fetches the queue via client.getQueue(), and returns mapped items with fields like id, title, status, trackedDownloadStatus, trackedDownloadState, protocol, downloadClient, size, sizeleft, timeleft.
async sonarrGetQueue(args: { limit?: number; } = {}): Promise<Record<string, unknown>> { const client = this.ensureSonarr(); const limit = args.limit || ARR_PREVIEW_LIMIT; try { const queue = await client.getQueue(); return { success: true, totalRecords: queue.totalRecords, items: queue.records.slice(0, limit).map((item) => ({ id: item.id, title: item.title, status: item.status, trackedDownloadStatus: item.trackedDownloadStatus, trackedDownloadState: item.trackedDownloadState, protocol: item.protocol, downloadClient: item.downloadClient, size: item.size, sizeleft: item.sizeleft, timeleft: item.timeleft, })), showing: Math.min(limit, queue.records.length), }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } } - src/arr/tool-schemas.ts:66-75 (schema)Input schema for sonarr_get_queue. Defines the tool name, description ('Get the current Sonarr download queue'), and inputSchema with a single optional 'limit' parameter (number, default 200).
{ name: "sonarr_get_queue", description: "Get the current Sonarr download queue", inputSchema: { type: "object" as const, properties: { limit: { type: "number", description: "Max results to return (default: 200)", default: 200 }, }, }, }, - src/arr/tool-registry.ts:42-44 (registration)Registration of sonarr_get_queue in the tool registry. Calls registry.register('sonarr_get_queue', ...) which delegates to arrFunctions.sonarrGetQueue() and wraps the result.
registry.register("sonarr_get_queue", (args) => arrFunctions.sonarrGetQueue({ limit: args.limit as number | undefined }).then(wrapResponse) ); - src/arr/constants.ts:11-11 (helper)The ARR_PREVIEW_LIMIT constant (value 200) used as the default limit when no explicit limit is provided.
export const ARR_PREVIEW_LIMIT = 200;