Skip to main content
Glama

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
NameRequiredDescriptionDefault

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: [], }, },
  • 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), }], }; }
  • 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'); }
  • 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; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aplaceforallmystuff/mcp-arr'

If you have feedback or need assistance with the MCP directory API, please join our Discord server