sonarr_search_missing
Search all missing episodes in a series to automatically find and download them via Sonarr.
Instructions
Trigger a search for all missing episodes in a series
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seriesId | Yes | Series ID to search for missing episodes |
Implementation Reference
- src/index.ts:294-307 (registration)Registration of the sonarr_search_missing tool with its input schema requiring a seriesId parameter.
{ name: "sonarr_search_missing", description: "Trigger a search for all missing episodes in a series", inputSchema: { type: "object" as const, properties: { seriesId: { type: "number", description: "Series ID to search for missing episodes", }, }, required: ["seriesId"], }, }, - src/index.ts:1544-1558 (handler)Handler for the sonarr_search_missing tool call. Validates Sonarr is configured, extracts the seriesId from args, calls clients.sonarr.searchMissing(seriesId), and returns a success response with the command ID.
case "sonarr_search_missing": { if (!clients.sonarr) throw new Error("Sonarr not configured"); const seriesId = (args as { seriesId: number }).seriesId; const result = await clients.sonarr.searchMissing(seriesId); return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Search triggered for missing episodes`, commandId: result.id, }, null, 2), }], }; } - src/arr-client.ts:581-589 (helper)Helper method on SonarrClient that sends a POST to /command with name 'SeriesSearch' and the seriesId to trigger searching for missing episodes via the Sonarr API.
async searchMissing(seriesId: number): Promise<{ id: number }> { return this['request']<{ id: number }>('/command', { method: 'POST', body: JSON.stringify({ name: 'SeriesSearch', seriesId, }), }); }