sonarr_add_series
Add a TV series to Sonarr by providing TVDB ID, title, quality profile, and root folder. Optionally set monitoring, season folders, and tags.
Instructions
Add a TV series to Sonarr. Use sonarr_search first to find the tvdbId, and sonarr_get_root_folders / sonarr_get_quality_profiles to get valid values for rootFolderPath and qualityProfileId. Use sonarr_get_tags to get valid tag IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tvdbId | Yes | TVDB ID from sonarr_search results | |
| title | Yes | Series title | |
| qualityProfileId | Yes | Quality profile ID from sonarr_get_quality_profiles | |
| rootFolderPath | Yes | Root folder path from sonarr_get_root_folders | |
| monitored | No | Whether to monitor the series (default: true) | |
| seasonFolder | No | Whether to use season folders (default: true) | |
| tags | No | Array of tag IDs from sonarr_get_tags (optional) |
Implementation Reference
- src/index.ts:337-375 (registration)Tool registration (schema definition) for sonarr_add_series in the TOOLS array, defining input parameters: tvdbId, title, qualityProfileId, rootFolderPath (required), and optional monitored, seasonFolder, tags.
{ name: "sonarr_add_series", description: "Add a TV series to Sonarr. Use sonarr_search first to find the tvdbId, and sonarr_get_root_folders / sonarr_get_quality_profiles to get valid values for rootFolderPath and qualityProfileId. Use sonarr_get_tags to get valid tag IDs.", inputSchema: { type: "object" as const, properties: { tvdbId: { type: "number", description: "TVDB ID from sonarr_search results", }, title: { type: "string", description: "Series title", }, qualityProfileId: { type: "number", description: "Quality profile ID from sonarr_get_quality_profiles", }, rootFolderPath: { type: "string", description: "Root folder path from sonarr_get_root_folders", }, monitored: { type: "boolean", description: "Whether to monitor the series (default: true)", }, seasonFolder: { type: "boolean", description: "Whether to use season folders (default: true)", }, tags: { type: "array", items: { type: "number" }, description: "Array of tag IDs from sonarr_get_tags (optional)", }, }, required: ["tvdbId", "title", "qualityProfileId", "rootFolderPath"], }, }, - src/index.ts:1598-1619 (handler)Handler for the sonarr_add_series tool call in the CallToolRequestSchema switch statement. Validates Sonarr is configured, extracts args, calls SonarrClient.addSeries(), and returns success response.
case "sonarr_add_series": { if (!clients.sonarr) throw new Error("Sonarr not configured"); const { tvdbId, title, qualityProfileId, rootFolderPath, monitored, seasonFolder, tags } = args as { tvdbId: number; title: string; qualityProfileId: number; rootFolderPath: string; monitored?: boolean; seasonFolder?: boolean; tags?: number[]; }; const added = await clients.sonarr.addSeries({ tvdbId, title, qualityProfileId, rootFolderPath, monitored, seasonFolder, tags: tags ?? [], }); return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Added "${added.title}" (${added.year}) to Sonarr`, id: added.id, path: added.path, monitored: added.monitored, }, null, 2), }], }; } - src/arr-client.ts:564-576 (helper)SonarrClient.addSeries() method - the actual API call. Sends a POST request to /series with the series data, defaulting monitored to true, seasonFolder to true, and setting searchForMissingEpisodes to true.
async addSeries(series: Partial<Series> & { tvdbId: number; rootFolderPath: string; qualityProfileId: number }): Promise<Series> { return this['request']<Series>('/series', { method: 'POST', body: JSON.stringify({ ...series, monitored: series.monitored ?? true, seasonFolder: series.seasonFolder ?? true, addOptions: { searchForMissingEpisodes: true, }, }), }); }