lidarr_search
Search for music artists to add to your Lidarr music management system using artist names.
Instructions
Search for artists to add to Lidarr
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | Search term (artist name) |
Implementation Reference
- src/index.ts:1302-1318 (handler)Primary MCP tool handler for 'lidarr_search': checks Lidarr configuration, extracts 'term' argument, invokes LidarrClient.searchArtists, slices top 10 results, truncates overviews, and returns formatted JSON response.case "lidarr_search": { if (!clients.lidarr) throw new Error("Lidarr not configured"); const term = (args as { term: string }).term; const results = await clients.lidarr.searchArtists(term); return { content: [{ type: "text", text: JSON.stringify({ count: results.length, results: results.slice(0, 10).map(r => ({ title: r.title, foreignArtistId: r.foreignArtistId, overview: r.overview?.substring(0, 200) + (r.overview && r.overview.length > 200 ? '...' : ''), })), }, null, 2), }], };
- src/index.ts:357-369 (schema)Input schema definition for 'lidarr_search' tool: requires a single 'term' string parameter for the artist search query.{ name: "lidarr_search", description: "Search for artists to add to Lidarr", inputSchema: { type: "object" as const, properties: { term: { type: "string", description: "Search term (artist name)", }, }, required: ["term"], },
- src/index.ts:346-436 (registration)Registers 'lidarr_search' and related Lidarr tools in the TOOLS array only if Lidarr client is configured (LIDARR_URL and LIDARR_API_KEY set).if (clients.lidarr) { TOOLS.push( { name: "lidarr_get_artists", description: "Get all artists in Lidarr library", inputSchema: { type: "object" as const, properties: {}, required: [], }, }, { name: "lidarr_search", description: "Search for artists to add to Lidarr", inputSchema: { type: "object" as const, properties: { term: { type: "string", description: "Search term (artist name)", }, }, required: ["term"], }, }, { name: "lidarr_get_queue", description: "Get Lidarr download queue", inputSchema: { type: "object" as const, properties: {}, required: [], }, }, { name: "lidarr_get_albums", description: "Get albums for an artist in Lidarr. Shows which albums are available and which are missing.", inputSchema: { type: "object" as const, properties: { artistId: { type: "number", description: "Artist ID to get albums for", }, }, required: ["artistId"], }, }, { name: "lidarr_search_album", description: "Trigger a search for a specific album to download", inputSchema: { type: "object" as const, properties: { albumId: { type: "number", description: "Album ID to search for", }, }, required: ["albumId"], }, }, { name: "lidarr_search_missing", description: "Trigger a search for all missing albums for an artist", inputSchema: { type: "object" as const, properties: { artistId: { type: "number", description: "Artist ID to search missing albums for", }, }, required: ["artistId"], }, }, { 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:752-754 (helper)Core implementation in LidarrClient: makes authenticated GET request to Lidarr API endpoint '/api/v1/artist/lookup?term={encoded_term}' to perform the artist search.async searchArtists(term: string): Promise<SearchResult[]> { return this['request']<SearchResult[]>(`/artist/lookup?term=${encodeURIComponent(term)}`); }
- src/index.ts:76-78 (helper)Creates LidarrClient instance with URL and API key from environment variables (LIDARR_URL, LIDARR_API_KEY) for use in tool handlers.case 'lidarr': clients.lidarr = new LidarrClient(config); break;