Skip to main content
Glama

lidarr_get_queue

Retrieve the current download queue from Lidarr to monitor pending music acquisition tasks and track progress.

Instructions

Get Lidarr download queue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for lidarr_get_queue tool: checks if Lidarr client is configured, fetches the download queue using clients.lidarr.getQueue(), formats the response with progress and returns as JSON text.
    case "lidarr_get_queue": { if (!clients.lidarr) throw new Error("Lidarr not configured"); const queue = await clients.lidarr.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/index.ts:372-378 (registration)
    Tool registration: defines the lidarr_get_queue tool name, description, and empty input schema. Added conditionally if Lidarr client is configured.
    name: "lidarr_get_queue", description: "Get Lidarr download queue", inputSchema: { type: "object" as const, properties: {}, required: [], },
  • LidarrClient.getQueue() method (inherited from ArrClient): makes API request to /queue endpoint with parameters to include 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 structure of queue items returned from the Lidarr 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; }
  • Core request method in ArrClient: handles authenticated API calls to the *arr service, used by getQueue() to fetch the queue data.
    protected async request<T>(endpoint: string, options: RequestInit = {}): Promise<T> { const url = `${this.config.url}/api/${this.apiVersion}${endpoint}`; const headers: Record<string, string> = { 'Content-Type': 'application/json', 'X-Api-Key': this.config.apiKey, ...(options.headers as Record<string, string> || {}), }; const response = await fetch(url, { ...options, headers, }); if (!response.ok) { const text = await response.text(); throw new Error(`${this.serviceName} API error: ${response.status} ${response.statusText} - ${text}`); } return response.json() as Promise<T>; }

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