readarr_search_book
Search for and download specific books by their ID numbers using the Readarr media management service.
Instructions
Trigger a search for a specific book to download
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bookIds | Yes | Book ID(s) to search for |
Implementation Reference
- src/arr-client.ts:906-914 (handler)Core implementation of the readarr_search_book tool: POST request to Readarr API /command with 'BookSearch' command and array of bookIds.async searchBook(bookIds: number[]): Promise<{ id: number }> { return this['request']<{ id: number }>('/command', { method: 'POST', body: JSON.stringify({ name: 'BookSearch', bookIds, }), }); }
- src/index.ts:488-502 (registration)Registration of the "readarr_search_book" tool: adds the Tool object to the TOOLS array if Readarr client is configured.{ name: "readarr_search_book", description: "Trigger a search for a specific book to download", inputSchema: { type: "object" as const, properties: { bookIds: { type: "array", items: { type: "number" }, description: "Book ID(s) to search for", }, }, required: ["bookIds"], }, },
- src/index.ts:491-501 (schema)Input schema definition for the readarr_search_book tool: requires array of bookIds.inputSchema: { type: "object" as const, properties: { bookIds: { type: "array", items: { type: "number" }, description: "Book ID(s) to search for", }, }, required: ["bookIds"], },
- src/index.ts:1507-1521 (handler)MCP server tool call handler: dispatches to ReadarrClient.searchBook and formats the response.case "readarr_search_book": { if (!clients.readarr) throw new Error("Readarr not configured"); const bookIds = (args as { bookIds: number[] }).bookIds; const result = await clients.readarr.searchBook(bookIds); return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Search triggered for ${bookIds.length} book(s)`, commandId: result.id, }, null, 2), }], }; }