Skip to main content
Glama

lidarr_get_queue

Retrieve the Lidarr download queue with pagination support using limit and offset parameters to manage results.

Instructions

Get Lidarr download queue. Supports pagination with limit and offset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of queue items to return (default: 25, max: 100)
offsetNoNumber of queue items to skip before returning results (default: 0)

Implementation Reference

  • Handler for lidarr_get_queue tool. Checks if Lidarr is configured, then calls getPaginatedQueue with the Lidarr client and user-provided limit/offset arguments.
    case "lidarr_get_queue": {
      if (!clients.lidarr) throw new Error("Lidarr not configured");
      return jsonText(await getPaginatedQueue(clients.lidarr, args as { limit?: number; offset?: number }));
    }
  • Shared helper function that fetches all pages of the queue from the API client, then applies limit/offset pagination. Returns formatted queue items with progress, status, download client info, and pagination metadata.
    type QueueCapableClient = SonarrClient | RadarrClient | LidarrClient;
    
    async function getPaginatedQueue(
      client: QueueCapableClient,
      args: { limit?: number; offset?: number } | undefined
    ) {
      const limit = Math.min(Math.max(Math.floor(args?.limit ?? 25), 1), 100);
      const offset = Math.max(Math.floor(args?.offset ?? 0), 0);
      const pageSize = 100;
      const records = [];
      let totalRecords = 0;
      let page = 1;
    
      while (true) {
        const queuePage = await client.getQueue(page, pageSize);
        totalRecords = queuePage.totalRecords;
        records.push(...queuePage.records);
    
        if (records.length >= totalRecords || queuePage.records.length === 0) {
          break;
        }
    
        page += 1;
      }
    
      const items = records.slice(offset, offset + limit).map((q) => ({
        title: q.title,
        status: q.status,
        progress: q.size > 0 ? ((1 - q.sizeleft / q.size) * 100).toFixed(1) + "%" : "unknown",
        timeLeft: q.timeleft,
        downloadClient: q.downloadClient,
        protocol: q.protocol,
        trackedDownloadStatus: q.trackedDownloadStatus,
        trackedDownloadState: q.trackedDownloadState,
      }));
    
      return {
        total: totalRecords,
        returned: items.length,
        offset,
        limit,
        hasMore: offset + items.length < totalRecords,
        nextOffset: offset + items.length < totalRecords ? offset + items.length : null,
        items,
      };
    }
  • src/index.ts:548-564 (registration)
    Tool registration for lidarr_get_queue. Defines the tool name, description, and input schema with optional limit (max 100) and offset parameters. Added to TOOLS array when Lidarr client is configured.
      name: "lidarr_get_queue",
      description: "Get Lidarr download queue. Supports pagination with limit and offset.",
      inputSchema: {
        type: "object" as const,
        properties: {
          limit: {
            type: "number",
            description: "Maximum number of queue items to return (default: 25, max: 100)",
          },
          offset: {
            type: "number",
            description: "Number of queue items to skip before returning results (default: 0)",
          },
        },
        required: [],
      },
    },
  • QueueItem interface defining the structure of items returned by the getQueue API call. Fields include title, status, size, progress, download client, protocol, and tracking information.
    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;
    }
  • The base ArrClient.getQueue method that calls the */api/v1/queue endpoint. Since LidarrClient extends ArrClient and inherits this, the actual API call for lidarr_get_queue uses this method.
    async getQueue(page = 1, pageSize = 100): Promise<{ records: QueueItem[]; totalRecords: number }> {
      const params = new URLSearchParams({
        includeUnknownSeriesItems: "true",
        includeUnknownMovieItems: "true",
        page: String(page),
        pageSize: String(pageSize),
      });
      return this.request<{ records: QueueItem[]; totalRecords: number }>(`/queue?${params.toString()}`);
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It correctly indicates pagination behavior (limit/offset) but does not explicitly state that the tool is read-only or does not modify data. There is no mention of authorization requirements, rate limits, or side effects. It is minimally adequate for a simple GET operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that front-loads the most important information ('Get Lidarr download queue'). It is extremely concise without any filler or redundancy, earning top marks.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description does not describe the structure of queue items or indicate what fields are returned. It covers pagination but lacks error handling, response size, or enumeration of skipped entries. It is adequate for a straightforward read operation but not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema coverage is 100% with clear descriptions for both 'limit' and 'offset'. The description adds 'Supports pagination with limit and offset', which reinforces the schema but does not add new meaning. Baseline for high coverage is 3, so this score is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'Get' and the resource 'Lidarr download queue', making the tool's purpose immediately apparent. It also mentions pagination, adding context. However, it does not differentiate from similar queue tools for other apps beyond specifying 'Lidarr', so it's slightly less than perfectly distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like lidarr_search or lidarr_add_artist. There is no mention of prerequisites, exclusions, or scenarios where this tool is preferred. The agent is left to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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