lidarr_search
Search for music artists by name to obtain the foreignArtistId required for adding artists to Lidarr.
Instructions
Search for artists by name. Returns results with foreignArtistId needed for lidarr_add_artist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | Search term (artist name) |
Implementation Reference
- src/index.ts:533-546 (schema)Tool registration and input schema for lidarr_search. Defines the tool name, description, and input schema requiring a 'term' string for searching artists.
{ name: "lidarr_search", description: "Search for artists by name. Returns results with foreignArtistId needed for lidarr_add_artist.", inputSchema: { type: "object" as const, properties: { term: { type: "string", description: "Search term (artist name)", }, }, required: ["term"], }, }, - src/index.ts:1788-1808 (handler)Handler for the lidarr_search tool. Takes a term/query/artist/name parameter, calls LidarrClient.searchArtists(), and returns up to 10 results with artistName, disambiguation, foreignArtistId, and truncated overview.
case "lidarr_search": { if (!clients.lidarr) throw new Error("Lidarr not configured"); const a = args as { term?: string; query?: string; artist?: string; name?: string }; const term = a.term ?? a.query ?? a.artist ?? a.name; if (!term) throw new Error("term required (artist name)"); const results = await clients.lidarr.searchArtists(term); return { content: [{ type: "text", text: JSON.stringify({ count: results.length, results: results.slice(0, 10).map(r => ({ artistName: r.artistName ?? r.title, disambiguation: r.disambiguation, foreignArtistId: r.foreignArtistId, overview: r.overview ? (r.overview.substring(0, 200) + (r.overview.length > 200 ? '...' : '')) : undefined, })), }, null, 2), }], }; } - src/arr-client.ts:721-723 (helper)LidarrClient.searchArtists() helper method. Sends a GET request to /artist/lookup with the search term, via the base ArrClient.request() method.
async searchArtists(term: string): Promise<SearchResult[]> { return this['request']<SearchResult[]>(`/artist/lookup?term=${encodeURIComponent(term)}`); }