lidarr_get_calendar
Retrieve upcoming album releases from Lidarr to plan music library updates and monitor new content availability.
Instructions
Get upcoming album releases from Lidarr
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Number of days to look ahead (default: 30) |
Implementation Reference
- src/index.ts:1398-1420 (handler)Main handler for the lidarr_get_calendar tool. Computes date range from input days parameter, calls LidarrClient.getCalendar, formats the album list response as JSON.case "lidarr_get_calendar": { if (!clients.lidarr) throw new Error("Lidarr 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.lidarr.getCalendar(start, end); return { content: [{ type: "text", text: JSON.stringify({ count: calendar.length, albums: calendar.map(a => ({ id: a.id, title: a.title, artistId: a.artistId, releaseDate: a.releaseDate, albumType: a.albumType, monitored: a.monitored, })), }, null, 2), }], }; }
- src/index.ts:423-435 (registration)Tool registration in TOOLS array, including name, description, and input schema definition (days: number, optional). Added conditionally if Lidarr client is configured.name: "lidarr_get_calendar", description: "Get upcoming album releases from Lidarr", inputSchema: { type: "object" as const, properties: { days: { type: "number", description: "Number of days to look ahead (default: 30)", }, }, required: [], }, }
- src/arr-client.ts:816-822 (helper)LidarrClient.getCalendar helper method: builds Lidarr /calendar API endpoint with start/end query parameters and performs the HTTP request via base request() method.async getCalendar(start?: string, end?: string): Promise<Album[]> { 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']<Album[]>(`/calendar${query}`); }
- src/arr-client.ts:183-217 (schema)TypeScript interface definition for Album, used as return type for getCalendar and in response formatting.export interface Album { id: number; title: string; disambiguation: string; overview: string; artistId: number; foreignAlbumId: string; monitored: boolean; anyReleaseOk: boolean; profileId: number; duration: number; albumType: string; genres: string[]; images: Array<{ coverType: string; url: string }>; links: Array<{ url: string; name: string }>; statistics?: { trackFileCount: number; trackCount: number; totalTrackCount: number; sizeOnDisk: number; percentOfTracks: number; }; releaseDate: string; releases: Array<{ id: number; albumId: number; foreignReleaseId: string; title: string; status: string; duration: number; trackCount: number; monitored: boolean; }>; grabbed: boolean; }