Skip to main content
Glama

sonarr_get_root_folders

Retrieve root folder paths and storage information from Sonarr to manage TV show media locations, including available space and unmapped directories.

Instructions

Get root folders and storage info from Sonarr (TV). Shows paths, free space, and unmapped folders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:106-172 (registration)
    Dynamic registration of configuration review tools including sonarr_get_root_folders via addConfigTools function, called conditionally for Sonarr
    function addConfigTools(serviceName: string, displayName: string) {
      TOOLS.push(
        {
          name: `${serviceName}_get_quality_profiles`,
          description: `Get detailed quality profiles from ${displayName}. Shows allowed qualities, upgrade settings, and custom format scores.`,
          inputSchema: {
            type: "object" as const,
            properties: {},
            required: [],
          },
        },
        {
          name: `${serviceName}_get_health`,
          description: `Get health check warnings and issues from ${displayName}. Shows any problems detected by the application.`,
          inputSchema: {
            type: "object" as const,
            properties: {},
            required: [],
          },
        },
        {
          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: [],
          },
        },
        {
          name: `${serviceName}_get_download_clients`,
          description: `Get download client configurations from ${displayName}. Shows configured clients and their settings.`,
          inputSchema: {
            type: "object" as const,
            properties: {},
            required: [],
          },
        },
        {
          name: `${serviceName}_get_naming`,
          description: `Get file naming configuration from ${displayName}. Shows naming patterns for files and folders.`,
          inputSchema: {
            type: "object" as const,
            properties: {},
            required: [],
          },
        },
        {
          name: `${serviceName}_get_tags`,
          description: `Get all tags defined in ${displayName}. Tags can be used to organize and filter content.`,
          inputSchema: {
            type: "object" as const,
            properties: {},
            required: [],
          },
        },
        {
          name: `${serviceName}_review_setup`,
          description: `Get comprehensive configuration review for ${displayName}. Returns all settings for analysis: quality profiles, download clients, naming, storage, indexers, health warnings, and more. Use this to analyze the setup and suggest improvements.`,
          inputSchema: {
            type: "object" as const,
            properties: {},
            required: [],
          },
        }
      );
    }
  • Tool schema definition for sonarr_get_root_folders (no input params required)
      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: [],
      },
    },
  • MCP tool handler: extracts service from tool name, calls client.getRootFoldersDetailed(), formats response with folder count, paths, accessibility, free space (formatted and bytes), unmapped folder counts
    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 helper method in ArrClient (inherited by SonarrClient) that fetches detailed root folder data from /rootfolder API endpoint
    async getRootFoldersDetailed(): Promise<RootFolder[]> {
      return this.request<RootFolder[]>('/rootfolder');
    }
  • Base request method used by all clients to make authenticated API calls to the *arr application
    protected async request<T>(endpoint: string, options: RequestInit = {}): Promise<T> {
      const url = `${this.config.url}/api/${this.apiVersion}${endpoint}`;
      const headers: Record<string, string> = {
        'Content-Type': 'application/json',
        'X-Api-Key': this.config.apiKey,
        ...(options.headers as Record<string, string> || {}),
      };
    
      const response = await fetch(url, {
        ...options,
        headers,
      });
    
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${this.serviceName} API error: ${response.status} ${response.statusText} - ${text}`);
      }
    
      return response.json() as Promise<T>;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates this is a read operation ('Get') and specifies the type of data returned (paths, free space, unmapped folders), which is helpful. However, it lacks details on potential side effects, error conditions, authentication needs, or rate limits. The description adds basic context but leaves behavioral aspects incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently conveys the tool's purpose, target system, and key output details. It is front-loaded with the main action and resource, and every part of the sentence adds value without redundancy or fluff, making it highly concise and effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no annotations, and no output schema, the description provides a clear purpose and output details, which is adequate for a simple read operation. However, it lacks information on the return format (e.g., structure of the data), error handling, or any system-specific constraints, leaving some contextual gaps that could hinder an agent's effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the schema description coverage is 100%, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the tool's purpose and output. This meets expectations for a parameterless tool, earning a high score as it avoids unnecessary details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get root folders and storage info'), the target resource ('from Sonarr (TV)'), and distinguishes it from siblings by specifying it's for TV content. It provides concrete details about what information is retrieved ('paths, free space, and unmapped folders'), making the purpose unambiguous and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'from Sonarr (TV)', which suggests it should be used for TV-related storage queries. However, it does not explicitly state when to use this tool versus alternatives like 'lidarr_get_root_folders' or 'radarr_get_root_folders', nor does it mention any prerequisites or exclusions. The guidance is present but not comprehensive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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