radarr_get_calendar
Retrieve upcoming movie releases from Radarr to plan and manage your media library schedule.
Instructions
Get upcoming movie releases from Radarr
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Number of days to look ahead (default: 30) |
Implementation Reference
- src/index.ts:314-327 (registration)Registration of the 'radarr_get_calendar' tool including name, description, and input schema (optional 'days' parameter).{ name: "radarr_get_calendar", description: "Get upcoming movie releases from Radarr", inputSchema: { type: "object" as const, properties: { days: { type: "number", description: "Number of days to look ahead (default: 30)", }, }, required: [], }, },
- src/index.ts:1252-1261 (handler)Top-level handler for 'radarr_get_calendar' tool: validates config, computes date range from 'days' param, calls RadarrClient.getCalendar, returns JSON response.case "radarr_get_calendar": { if (!clients.radarr) throw new Error("Radarr not configured"); const days = (args as { days?: number })?.days || 30; const start = new Date().toISOString().split('T')[0]; const end = new Date(Date.now() + days * 24 * 60 * 60 * 1000).toISOString().split('T')[0]; const calendar = await clients.radarr.getCalendar(start, end); return { content: [{ type: "text", text: JSON.stringify(calendar, null, 2) }], }; }
- src/arr-client.ts:499-505 (handler)Core implementation in ArrClient.getCalendar (inherited by RadarrClient): constructs /api/v3/calendar?start=...&end=... API request and executes it via this.request()async getCalendar(start?: string, end?: string): Promise<unknown[]> { const params = new URLSearchParams(); if (start) params.append('start', start); if (end) params.append('end', end); const query = params.toString() ? `?${params.toString()}` : ''; return this.request<unknown[]>(`/calendar${query}`); }
- src/arr-client.ts:461-480 (handler)ArrClient.request method: performs the authenticated fetch to Radarr API with error handling, used by getCalendar.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>; }