sonarr_get_root_folders
Retrieve root folder information and storage details from Sonarr for TV shows, including paths, available space, and unmapped folders.
Instructions
Get root folders and storage info from Sonarr (TV). 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)Primary MCP tool handler for 'sonarr_get_root_folders'. Dispatches to SonarrClient.getRootFoldersDetailed(), formats the response with byte formatting, and returns structured JSON output.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)Tool registration in addConfigTools function. Dynamically creates the 'sonarr_get_root_folders' tool definition (name, description, empty input schema) and adds to TOOLS array when Sonarr is configured.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:578-580 (handler)Core API handler method getRootFoldersDetailed() in ArrClient base class (used by SonarrClient). Performs authenticated GET request to /api/v3/rootfolder endpoint.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 for type safety in getRootFoldersDetailed().export interface RootFolder { id: number; path: string; accessible: boolean; freeSpace: number; unmappedFolders?: Array<{ name: string; path: string }>; }
- src/index.ts:175-175 (registration)Conditional registration call that triggers addition of 'sonarr_get_root_folders' tool to the TOOLS list if Sonarr client is configured.if (clients.sonarr) addConfigTools('sonarr', 'Sonarr (TV)');