sonarr_refresh_series
Trigger a metadata refresh for a specific TV series in Sonarr using its series ID.
Instructions
Trigger a metadata refresh for a specific series in Sonarr
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seriesId | Yes | Series ID to refresh |
Implementation Reference
- src/index.ts:324-336 (registration)Tool registration for 'sonarr_refresh_series' with input schema requiring a seriesId number.
name: "sonarr_refresh_series", description: "Trigger a metadata refresh for a specific series in Sonarr", inputSchema: { type: "object" as const, properties: { seriesId: { type: "number", description: "Series ID to refresh", }, }, required: ["seriesId"], }, }, - src/index.ts:1576-1596 (handler)Handler function for sonarr_refresh_series tool. Calls clients.sonarr.getSeriesById(seriesId) to get series info, then clients.sonarr.refreshSeries(seriesId) to trigger the refresh command.
case "sonarr_refresh_series": { if (!clients.sonarr) throw new Error("Sonarr not configured"); const seriesId = (args as { seriesId: number }).seriesId; const series = await clients.sonarr.getSeriesById(seriesId); const result = await clients.sonarr.refreshSeries(seriesId); return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Refresh triggered for series`, series: { id: series.id, title: series.title, year: series.year, }, commandId: result.id, }, null, 2), }], }; } - src/arr-client.ts:618-626 (helper)SonarrClient.refreshSeries() method - posts a POST request to /command with {name: 'RefreshSeries', seriesId} to trigger a metadata refresh.
async refreshSeries(seriesId: number): Promise<{ id: number }> { return this['request']<{ id: number }>('/command', { method: 'POST', body: JSON.stringify({ name: 'RefreshSeries', seriesId, }), }); } - src/arr-client.ts:550-552 (helper)SonarrClient.getSeriesById() method - fetches a specific series by ID from /series/{id}, used by the handler to get the series title/year for the response.
async getSeriesById(id: number): Promise<Series> { return this['request']<Series>(`/series/${id}`); }