radarr_get_calendar
Retrieve upcoming movie releases from Radarr for a specified number of days. Plan your media library updates in advance.
Instructions
Get upcoming movie releases from Radarr
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Number of days to look ahead (default: 30) |
Implementation Reference
- src/index.ts:1693-1702 (handler)The tool handler for 'radarr_get_calendar' in the CallToolRequestSchema switch statement. It checks Radarr is configured, extracts optional 'days' parameter (default 30), computes ISO date range, calls clients.radarr.getCalendar(start, end), and returns the 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/index.ts:437-449 (schema)The tool registration/schema for 'radarr_get_calendar' in the TOOLS array. Defines the tool name, description ('Get upcoming movie releases from Radarr'), and input schema with an optional 'days' parameter (default 30).
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:437-449 (registration)The tool is registered in the TOOLS array at lines 436-449, conditional on clients.radarr being configured (line 380).
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/arr-client.ts:439-448 (helper)The getCalendar method on the base ArrClient class. Accepts optional start/end strings, appends them as query parameters, and makes a GET request to /calendar.
/** * Get calendar items (upcoming releases) */ 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:629-695 (helper)The RadarrClient class extends ArrClient. It inherits the getCalendar method (defined in ArrClient at lines 442-448) with no override, so the base implementation is used.
export class RadarrClient extends ArrClient { constructor(config: ArrConfig) { super('radarr', config); } /** * Get all movies */ async getMovies(): Promise<Movie[]> { return this['request']<Movie[]>('/movie'); } /** * Get a specific movie */ async getMovieById(id: number): Promise<Movie> { return this['request']<Movie>(`/movie/${id}`); } /** * Search for movies */ async searchMovies(term: string): Promise<SearchResult[]> { return this['request']<SearchResult[]>(`/movie/lookup?term=${encodeURIComponent(term)}`); } /** * Add a movie */ async addMovie(movie: Partial<Movie> & { tmdbId: number; rootFolderPath: string; qualityProfileId: number }): Promise<Movie> { return this['request']<Movie>('/movie', { method: 'POST', body: JSON.stringify({ ...movie, monitored: movie.monitored ?? true, addOptions: { searchForMovie: true, }, }), }); } /** * Trigger a search for a movie */ async searchMovie(movieId: number): Promise<{ id: number }> { return this['request']<{ id: number }>('/command', { method: 'POST', body: JSON.stringify({ name: 'MoviesSearch', movieIds: [movieId], }), }); } /** * Trigger a refresh for a specific movie */ async refreshMovie(movieId: number): Promise<{ id: number }> { return this['request']<{ id: number }>('/command', { method: 'POST', body: JSON.stringify({ name: 'RefreshMovie', movieIds: [movieId], }), }); }