sonarr_get_root_folders
Retrieves root folder paths, free space, and unmapped folders from Sonarr for TV storage management.
Instructions
Get root folders and storage info from Sonarr (TV). Shows paths, free space, and unmapped folders.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:153-160 (registration)Tool 'sonarr_get_root_folders' is dynamically registered via addConfigTools('sonarr', ...). This generates the tool name, description, and inputSchema for sonarr_get_root_folders.
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:520-523 (helper)The getRootFoldersDetailed() method on ArrClient (base class of SonarrClient) calls the /rootfolder API endpoint and returns RootFolder[] with full details (id, path, accessible, freeSpace, unmappedFolders).
*/ async getRootFoldersDetailed(): Promise<RootFolder[]> { return this.request<RootFolder[]>('/rootfolder'); } - src/index.ts:1245-1268 (handler)The handler for sonarr_get_root_folders (alongside radarr_ and lidarr_ variants) resolves the service name, calls client.getRootFoldersDetailed(), and formats the response with folder details including formatted free space.
case "sonarr_get_root_folders": case "radarr_get_root_folders": case "lidarr_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), }], }; }