Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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), }], }; }
  • 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'); }
  • 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)');
  • 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 }>; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aplaceforallmystuff/mcp-arr'

If you have feedback or need assistance with the MCP directory API, please join our Discord server