readarr_get_books
Retrieve book availability for an author in Readarr, showing which titles are present and which require acquisition to complete your collection.
Instructions
Get books for an author in Readarr. Shows which books are available and which are missing.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| authorId | Yes | Author ID to get books for |
Implementation Reference
- src/index.ts:474-487 (registration)Registration of the 'readarr_get_books' tool including its name, description, and input schema (requires authorId). Added to TOOLS array if Readarr client is configured.{ name: "readarr_get_books", description: "Get books for an author in Readarr. Shows which books are available and which are missing.", inputSchema: { type: "object" as const, properties: { authorId: { type: "number", description: "Author ID to get books for", }, }, required: ["authorId"], }, },
- src/index.ts:1483-1505 (handler)MCP tool handler for 'readarr_get_books': validates Readarr config, calls client.getBooks(authorId), maps response to summary fields (id, title, releaseDate, pageCount, monitored, hasFile, sizeOnDisk, grabbed), returns formatted JSON.case "readarr_get_books": { if (!clients.readarr) throw new Error("Readarr not configured"); const authorId = (args as { authorId: number }).authorId; const books = await clients.readarr.getBooks(authorId); return { content: [{ type: "text", text: JSON.stringify({ count: books.length, books: books.map(b => ({ id: b.id, title: b.title, releaseDate: b.releaseDate, pageCount: b.pageCount, monitored: b.monitored, hasFile: b.statistics ? b.statistics.bookFileCount > 0 : false, sizeOnDisk: formatBytes(b.statistics?.sizeOnDisk || 0), grabbed: b.grabbed, })), }, null, 2), }], }; }
- src/arr-client.ts:878-881 (handler)Core implementation in ReadarrClient.getBooks(): Performs GET request to /api/v1/book?authorId={authorId} via base request() method, returning array of Book objects.async getBooks(authorId?: number): Promise<Book[]> { const url = authorId ? `/book?authorId=${authorId}` : '/book'; return this['request']<Book[]>(url); }