readarr_get_root_folders
Retrieve root folder paths, storage capacity, and unmapped directories from Readarr for managing book library organization and storage allocation.
Instructions
Get root folders and storage info from Readarr (Books). Shows paths, free space, and unmapped folders.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:856-880 (handler)Main handler for readarr_get_root_folders (and other _get_root_folders tools): parses service name, retrieves client, calls getRootFoldersDetailed(), formats response with folder paths, accessibility, free space, and unmapped folder count.case "sonarr_get_root_folders": case "radarr_get_root_folders": case "lidarr_get_root_folders": case "readarr_get_root_folders": { const serviceName = name.split('_')[0] as keyof typeof clients; const client = clients[serviceName]; if (!client) throw new Error(`${serviceName} not configured`); const folders = await client.getRootFoldersDetailed(); return { content: [{ type: "text", text: JSON.stringify({ count: folders.length, folders: folders.map(f => ({ id: f.id, path: f.path, accessible: f.accessible, freeSpace: formatBytes(f.freeSpace), freeSpaceBytes: f.freeSpace, unmappedFolders: f.unmappedFolders?.length || 0, })), }, null, 2), }], }; }
- src/arr-client.ts:578-580 (handler)Core implementation in ArrClient (inherited by ReadarrClient): fetches root folders data via API GET /rootfolder, returns array of RootFolder objects.async getRootFoldersDetailed(): Promise<RootFolder[]> { return this.request<RootFolder[]>('/rootfolder'); }
- src/index.ts:127-134 (schema)Tool schema definition template used to register readarr_get_root_folders: empty input schema (no parameters), descriptive name and description.name: `${serviceName}_get_root_folders`, description: `Get root folders and storage info from ${displayName}. Shows paths, free space, and unmapped folders.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, },
- src/index.ts:178-178 (registration)Registration call that adds the readarr_get_root_folders tool to the TOOLS array if Readarr client is configured.if (clients.readarr) addConfigTools('readarr', 'Readarr (Books)');
- src/arr-client.ts:406-412 (schema)Type definition for RootFolder used in getRootFoldersDetailed response, including path, accessibility, free space, and unmapped folders.export interface RootFolder { id: number; path: string; accessible: boolean; freeSpace: number; unmappedFolders?: Array<{ name: string; path: string }>; }