Skip to main content
Glama

queue_grab

Force retry downloads of queued media items by specifying service and IDs to resolve stalled or failed transfers in media management workflows.

Instructions

Force grab/retry download of queued items

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYes
serviceYes

Implementation Reference

  • Core implementation of the queue_grab tool. Makes API calls to Sonarr/Radarr /queue/grab endpoints to force download/retry queued items, handling single or bulk IDs.
    async queueGrab(ids: number[]): Promise<OperationResult<GrabData>> {
    	debugOperation(this.serviceName, "queueGrab", {
    		ids: ids.slice(0, 5),
    		count: ids.length,
    	});
    	try {
    		if (ids.length === 0) {
    			throw new Error("No IDs provided");
    		}
    
    		if (ids.length === 1) {
    			await fetchJson(this.buildApiUrl(`/queue/grab/${ids[0]}`), {
    				method: "POST",
    			});
    		} else {
    			await fetchJson(this.buildApiUrl("/queue/grab/bulk"), {
    				method: "POST",
    				headers: { "Content-Type": "application/json" },
    				body: JSON.stringify({ ids }),
    			});
    		}
    
    		return {
    			ok: true,
    			data: {
    				service: this.serviceName,
    				mediaKind: this.mediaKind,
    				grabbed: ids.length,
    				ids,
    			},
    		};
    	} catch (error) {
    		return handleError(error, this.serviceName);
    	}
    }
  • MCP tool schema definition including input schema requiring 'service' and 'ids' array.
    name: "queue_grab",
    description: "Force grab/retry download of queued items",
    inputSchema: {
      type: "object",
      properties: {
        service: { type: "string" },
        ids: { type: "array", items: { type: "number" } },
      },
      required: ["service", "ids"],
    },
  • src/index.ts:282-289 (registration)
    Tool registration and dispatch in the main switch statement, validating input and calling service.queueGrab.
    case "queue_grab":
      if (!input.ids || input.ids.length === 0) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Missing or empty ids array",
        );
      }
      return await service.queueGrab(input.ids);
  • Type definition for the GrabData return type used by queueGrab.
    export interface GrabData {
    	service: string;
    	mediaKind: "series" | "movie";
    	grabbed: number;
    	ids: number[];
    }
  • Interface declaration for the queueGrab method in ServiceImplementation.
    queueGrab(ids: number[]): Promise<OperationResult<GrabData>>;

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/thesammykins/FlixBridge'

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