Skip to main content
Glama

sonarr_get_episodes

Retrieve episode availability for TV series in Sonarr, showing which episodes are present and which need downloading to manage your media library.

Instructions

Get episodes for a TV series. Shows which episodes are available and which are missing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seriesIdYesSeries ID to get episodes for
seasonNumberNoOptional: filter to a specific season

Implementation Reference

  • src/index.ts:230-246 (registration)
    Registration of the 'sonarr_get_episodes' tool in the TOOLS array, including name, description, and input schema. Added conditionally if Sonarr client is configured.
      name: "sonarr_get_episodes",
      description: "Get episodes for a TV series. Shows which episodes are available and which are missing.",
      inputSchema: {
        type: "object" as const,
        properties: {
          seriesId: {
            type: "number",
            description: "Series ID to get episodes for",
          },
          seasonNumber: {
            type: "number",
            description: "Optional: filter to a specific season",
          },
        },
        required: ["seriesId"],
      },
    },
  • MCP tool handler for 'sonarr_get_episodes': validates Sonarr config, extracts args, calls SonarrClient.getEpisodes(), formats response as JSON.
    case "sonarr_get_episodes": {
      if (!clients.sonarr) throw new Error("Sonarr not configured");
      const { seriesId, seasonNumber } = args as { seriesId: number; seasonNumber?: number };
      const episodes = await clients.sonarr.getEpisodes(seriesId, seasonNumber);
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            count: episodes.length,
            episodes: episodes.map(e => ({
              id: e.id,
              seasonNumber: e.seasonNumber,
              episodeNumber: e.episodeNumber,
              title: e.title,
              airDate: e.airDate,
              hasFile: e.hasFile,
              monitored: e.monitored,
            })),
          }, null, 2),
        }],
      };
    }
  • Core implementation in SonarrClient: constructs API endpoint /api/v3/episode?seriesId=... [&seasonNumber=...] and fetches episodes via base request method.
    async getEpisodes(seriesId: number, seasonNumber?: number): Promise<Episode[]> {
      let url = `/episode?seriesId=${seriesId}`;
      if (seasonNumber !== undefined) {
        url += `&seasonNumber=${seasonNumber}`;
      }
      return this['request']<Episode[]>(url);
    }
Behavior2/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 states the tool retrieves episode information and indicates availability status, but doesn't describe important behavioral aspects: whether this is a read-only operation, what authentication is required, how results are formatted, if there are rate limits, or what happens with invalid inputs. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness4/5

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

The description is appropriately concise with two sentences that efficiently convey the core functionality. The first sentence states the primary purpose, and the second adds useful context about what information is returned. There's no wasted language, though it could potentially be structured more clearly as a single sentence.

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's moderate complexity (retrieving episode data with filtering), no annotations, no output schema, and 100% schema coverage, the description provides basic but incomplete context. It explains what the tool does but lacks important behavioral details that would help an agent use it correctly. The absence of an output schema means the description should ideally provide more information about return values, but it only partially addresses this with the availability/missing status mention.

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

Parameters3/5

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

The input schema has 100% description coverage, with both parameters clearly documented in the schema itself. The description doesn't add any parameter-specific information beyond what's already in the schema descriptions. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get episodes for a TV series' specifies the verb (get) and resource (episodes for a TV series). It adds context about what information is returned ('Shows which episodes are available and which are missing'), which helps distinguish it from generic list operations. However, it doesn't explicitly differentiate from sibling tools like 'sonarr_get_series' or 'sonarr_search_episode'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'sonarr_get_series' (which might provide series metadata) or 'sonarr_search_episode' (which might search for specific episodes). There's no context about prerequisites, timing, or constraints for using this tool.

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