sonarr_get_series
Retrieve a list of series from Sonarr, optionally filtered by title substring.
Instructions
List all series in Sonarr with optional title filter
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Optional title substring filter | |
| limit | No | Max results to return (default: 200) |
Implementation Reference
- src/arr/mcp-functions.ts:70-109 (handler)The main handler function that executes the 'sonarr_get_series' tool logic. It initializes the Sonarr client, optionally filters series by title, and returns a sliced/previewed list of series with key statistics.
async sonarrGetSeries(args: { filter?: string; limit?: number; }): Promise<Record<string, unknown>> { const client = this.ensureSonarr(); const limit = args.limit || ARR_PREVIEW_LIMIT; try { let series = await client.getSeries(); if (args.filter) { const f = args.filter.toLowerCase(); series = series.filter((s) => s.title.toLowerCase().includes(f)); } return { success: true, totalSeries: series.length, series: series.slice(0, limit).map((s) => ({ id: s.id, title: s.title, year: s.year, status: s.status, network: s.network, monitored: s.monitored, seasons: s.statistics.seasonCount, episodeFileCount: s.statistics.episodeFileCount, episodeCount: s.statistics.episodeCount, percentOfEpisodes: s.statistics.percentOfEpisodes, sizeOnDisk: s.statistics.sizeOnDisk, tvdbId: s.tvdbId, imdbId: s.imdbId, overview: s.overview ? truncate(s.overview, SUMMARY_PREVIEW_LENGTH) : undefined, })), showing: Math.min(limit, series.length), }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } } - src/arr/tool-schemas.ts:9-19 (schema)Input schema definition for sonarr_get_series, declaring optional 'filter' (string) and 'limit' (number) parameters with descriptions.
{ name: "sonarr_get_series", description: "List all series in Sonarr with optional title filter", inputSchema: { type: "object" as const, properties: { filter: { type: "string", description: "Optional title substring filter" }, limit: { type: "number", description: "Max results to return (default: 200)", default: 200 }, }, }, }, - src/arr/tool-registry.ts:14-16 (registration)Registration of sonarr_get_series in the tool registry, mapping the tool name to a call to arrFunctions.sonarrGetSeries with args extraction.
registry.register("sonarr_get_series", (args) => arrFunctions.sonarrGetSeries({ filter: args.filter as string | undefined, limit: args.limit as number | undefined }).then(wrapResponse) );