Skip to main content
Glama

sonarr_get_series

Get TV series from your Sonarr library with pagination and optional title filtering. Use limit and offset to fetch specific pages.

Instructions

Get TV series from Sonarr library with optional pagination and title filtering. Defaults to limit=25 to avoid very large responses. Use offset to fetch additional pages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of series to return (default: 25, max: 100)
offsetNoNumber of series to skip before returning results (default: 0)
searchNoOptional case-insensitive title filter

Implementation Reference

  • src/index.ts:209-229 (registration)
    Tool registration/schema definition for 'sonarr_get_series'. Defines the tool name, description, and inputSchema with optional params: limit (default 25, max 100), offset (default 0), and search (case-insensitive title filter).
      name: "sonarr_get_series",
      description: "Get TV series from Sonarr library with optional pagination and title filtering. Defaults to limit=25 to avoid very large responses. Use offset to fetch additional pages.",
      inputSchema: {
        type: "object" as const,
        properties: {
          limit: {
            type: "number",
            description: "Maximum number of series to return (default: 25, max: 100)",
          },
          offset: {
            type: "number",
            description: "Number of series to skip before returning results (default: 0)",
          },
          search: {
            type: "string",
            description: "Optional case-insensitive title filter",
          },
        },
        required: [],
      },
    },
  • Handler function for 'sonarr_get_series' tool call. Fetches all series from Sonarr via clients.sonarr.getSeries(), applies optional case-insensitive title filtering, paginates with limit/offset, and returns a JSON response with series details (id, title, year, status, network, seasons, episodes, sizeOnDisk, monitored).
    case "sonarr_get_series": {
      if (!clients.sonarr) throw new Error("Sonarr not configured");
      const { limit = 25, offset = 0, search } = args as {
        limit?: number;
        offset?: number;
        search?: string;
      };
      const normalizedLimit = Math.max(1, Math.min(limit, 100));
      const normalizedOffset = Math.max(0, offset);
      const filter = search?.trim().toLowerCase();
    
      const allSeries = await clients.sonarr.getSeries();
      const filteredSeries = filter
        ? allSeries.filter(s => s.title.toLowerCase().includes(filter))
        : allSeries;
      const pagedSeries = filteredSeries.slice(normalizedOffset, normalizedOffset + normalizedLimit);
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            total: allSeries.length,
            filteredCount: filteredSeries.length,
            returned: pagedSeries.length,
            offset: normalizedOffset,
            limit: normalizedLimit,
            hasMore: normalizedOffset + normalizedLimit < filteredSeries.length,
            nextOffset: normalizedOffset + normalizedLimit < filteredSeries.length
              ? normalizedOffset + normalizedLimit
              : null,
            search: search ?? null,
            series: pagedSeries.map(s => ({
              id: s.id,
              title: s.title,
              year: s.year,
              status: s.status,
              network: s.network,
              seasons: s.statistics?.seasonCount,
              episodes: s.statistics?.episodeFileCount + '/' + s.statistics?.totalEpisodeCount,
              sizeOnDisk: formatBytes(s.statistics?.sizeOnDisk || 0),
              monitored: s.monitored,
            })),
          }, null, 2),
        }],
      };
    }
  • Helper method `getSeries()` in SonarrClient class. Makes the actual API call to GET /api/v3/series to retrieve all series from Sonarr. Returns an array of Series objects.
    async getSeries(): Promise<Series[]> {
      return this['request']<Series[]>('/series');
    }
  • TypeScript interface `Series` defining the shape of series data returned by the Sonarr API, used by the tool handler to shape the response.
    export interface Series {
      id: number;
      title: string;
      sortTitle: string;
      status: string;
      overview: string;
      network: string;
      airTime: string;
      images: Array<{ coverType: string; url: string }>;
      seasons: Array<{ seasonNumber: number; monitored: boolean }>;
      year: number;
      path: string;
      qualityProfileId: number;
      seasonFolder: boolean;
      monitored: boolean;
      runtime: number;
      tvdbId: number;
      tvRageId: number;
      tvMazeId: number;
      firstAired: string;
      seriesType: string;
      cleanTitle: string;
      imdbId: string;
      titleSlug: string;
      genres: string[];
      tags: number[];
      added: string;
      ratings: { votes: number; value: number };
      statistics: {
        seasonCount: number;
        episodeFileCount: number;
        episodeCount: number;
        totalEpisodeCount: number;
        sizeOnDisk: number;
        percentOfEpisodes: number;
      };
    }
Behavior3/5

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

No annotations exist, so description must disclose behavior. It mentions default limit to avoid large responses, which is helpful. However, it does not cover ordering, caching, or whether the response is sorted.

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?

Two concise sentences. First sentence states purpose and optional features; second provides pagination details. No redundant words.

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?

No output schema, so description should ideally hint at return structure. It does not mention the format or fields of the returned series, or whether pagination metadata is included. Adequate but incomplete.

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?

Input schema has 100% description coverage for all three parameters. The description adds value by explaining the default limit and how to use offset for pagination, enhancing understanding beyond the schema.

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 action ('Get TV series'), the resource ('from Sonarr library'), and the optional features (pagination, title filtering). It distinguishes itself from siblings like sonarr_get_episodes and sonarr_search by specifying 'TV series'.

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

Usage Guidelines4/5

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

Provides guidance on pagination: default limit, use offset for additional pages. Does not explicitly mention when not to use or alternatives, but the purpose is straightforward given the tool name.

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