radarr_search
Search for movies to add to your Radarr media library by entering a movie title or search term.
Instructions
Search for movies to add to Radarr
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | Search term (movie name) |
Implementation Reference
- src/index.ts:1211-1230 (handler)Handler function in the MCP tool call switch statement that extracts the search term, calls RadarrClient.searchMovies(term), limits results to 10, and returns formatted JSON response.case "radarr_search": { if (!clients.radarr) throw new Error("Radarr not configured"); const term = (args as { term: string }).term; const results = await clients.radarr.searchMovies(term); return { content: [{ type: "text", text: JSON.stringify({ count: results.length, results: results.slice(0, 10).map(r => ({ title: r.title, year: r.year, tmdbId: r.tmdbId, imdbId: r.imdbId, overview: r.overview?.substring(0, 200) + (r.overview && r.overview.length > 200 ? '...' : ''), })), }, null, 2), }], }; }
- src/index.ts:292-304 (schema)Input schema definition and tool registration (added to TOOLS array if Radarr client configured). Defines required 'term' string parameter.name: "radarr_search", description: "Search for movies to add to Radarr", inputSchema: { type: "object" as const, properties: { term: { type: "string", description: "Search term (movie name)", }, }, required: ["term"], }, },
- src/arr-client.ts:695-697 (handler)Core handler method in RadarrClient that performs the actual API request to Radarr's /movie/lookup endpoint with the search term.async searchMovies(term: string): Promise<SearchResult[]> { return this['request']<SearchResult[]>(`/movie/lookup?term=${encodeURIComponent(term)}`); }
- src/arr-client.ts:673-697 (helper)RadarrClient class definition including the searchMovies method and other movie-related helpers.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)}`); }
- src/index.ts:67-86 (registration)Client instantiation loop where RadarrClient is created if RADARR_URL and RADARR_API_KEY are set, enabling radarr_search tool.for (const service of configuredServices) { const config = { url: service.url!, apiKey: service.apiKey! }; switch (service.name) { case 'sonarr': clients.sonarr = new SonarrClient(config); break; case 'radarr': clients.radarr = new RadarrClient(config); break; case 'lidarr': clients.lidarr = new LidarrClient(config); break; case 'readarr': clients.readarr = new ReadarrClient(config); break; case 'prowlarr': clients.prowlarr = new ProwlarrClient(config); break; } }