readarr_search
Search for authors to add to Readarr for book management. Enter an author name to find and add them to your library.
Instructions
Search for authors to add to Readarr
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | Search term (author name) |
Implementation Reference
- src/index.ts:1444-1461 (handler)Primary MCP tool handler for 'readarr_search': validates Readarr client, extracts search term from arguments, invokes ReadarrClient.searchAuthors(term), slices results to top 10, and returns formatted JSON response with count and author search results.case "readarr_search": { if (!clients.readarr) throw new Error("Readarr not configured"); const term = (args as { term: string }).term; const results = await clients.readarr.searchAuthors(term); return { content: [{ type: "text", text: JSON.stringify({ count: results.length, results: results.slice(0, 10).map(r => ({ title: r.title, foreignAuthorId: r.foreignAuthorId, overview: r.overview?.substring(0, 200) + (r.overview && r.overview.length > 200 ? '...' : ''), })), }, null, 2), }], }; }
- src/index.ts:451-464 (registration)Registers the 'readarr_search' tool in the MCP TOOLS array (conditional on Readarr client configuration), defining name, description, and input schema requiring a 'term' string parameter.{ name: "readarr_search", description: "Search for authors to add to Readarr", inputSchema: { type: "object" as const, properties: { term: { type: "string", description: "Search term (author name)", }, }, required: ["term"], }, },
- src/index.ts:454-463 (schema)Input schema definition for the 'readarr_search' tool: requires a single 'term' property of type string.inputSchema: { type: "object" as const, properties: { term: { type: "string", description: "Search term (author name)", }, }, required: ["term"], },
- src/arr-client.ts:852-857 (handler)Underlying handler in ReadarrClient: performs authenticated API GET request to Readarr's /author/lookup endpoint with encoded search term, returning array of SearchResult objects./** * Search for authors */ async searchAuthors(term: string): Promise<SearchResult[]> { return this['request']<SearchResult[]>(`/author/lookup?term=${encodeURIComponent(term)}`); }
- src/index.ts:79-81 (helper)Initializes the ReadarrClient instance from environment variables (READARR_URL, READARR_API_KEY) if configured, storing in global clients object for tool handlers to use.case 'readarr': clients.readarr = new ReadarrClient(config); break;