radarr_get_root_folders
Retrieve root folder paths, storage capacity, and unmapped directories from Radarr for managing movie library organization and monitoring available disk space.
Instructions
Get root folders and storage info from Radarr (Movies). 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)The primary handler function for the 'radarr_get_root_folders' tool. It extracts the service name, retrieves the RadarrClient instance, calls getRootFoldersDetailed(), formats the response with free space in human-readable format, and returns JSON.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/index.ts:127-134 (registration)Registers the 'radarr_get_root_folders' tool (dynamically via serviceName='radarr') in the TOOLS array, including its name, description, and empty input schema.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/arr-client.ts:575-580 (helper)Supporting utility method in the base ArrClient class (inherited by RadarrClient) that performs the actual API request to fetch detailed root folder information from the *arr service./** * Get detailed root folders */ async getRootFoldersDetailed(): Promise<RootFolder[]> { return this.request<RootFolder[]>('/rootfolder'); }
- src/arr-client.ts:406-412 (schema)TypeScript interface defining the structure of root folder data returned by the API, used in getRootFoldersDetailed() and the tool response.export interface RootFolder { id: number; path: string; accessible: boolean; freeSpace: number; unmappedFolders?: Array<{ name: string; path: string }>; }