sonarr_trigger_search
Trigger a search for missing episodes in Sonarr, with an option to target a specific series.
Instructions
Trigger a search for missing episodes, optionally for a specific series
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seriesId | No | Sonarr series ID (omit to search all missing) |
Implementation Reference
- src/arr/mcp-functions.ts:347-372 (handler)Main handler: sonarrTriggerSearch method on ArrMCPFunctions class. Calls client.triggerSeriesSearch(seriesId) if seriesId is provided, otherwise calls client.triggerMissingSearch() for all missing episodes. Returns success/error response.
async sonarrTriggerSearch(args: { seriesId?: number; }): Promise<Record<string, unknown>> { const client = this.ensureSonarr(); try { if (args.seriesId) { const result = await client.triggerSeriesSearch(args.seriesId); return { success: true, commandId: result.id, message: `Triggered search for series ${args.seriesId}`, }; } const result = await client.triggerMissingSearch(); return { success: true, commandId: result.id, message: "Triggered search for all missing episodes", }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } } - src/arr/tool-schemas.ts:94-102 (schema)Schema definition for sonarr_trigger_search tool with optional seriesId input parameter.
name: "sonarr_trigger_search", description: "Trigger a search for missing episodes, optionally for a specific series", inputSchema: { type: "object" as const, properties: { seriesId: { type: "number", description: "Sonarr series ID (omit to search all missing)" }, }, }, }, - src/arr/tool-registry.ts:58-62 (registration)Registration of 'sonarr_trigger_search' in the tool registry, mapping to arrFunctions.sonarrTriggerSearch with argument casting.
registry.register("sonarr_trigger_search", (args) => arrFunctions.sonarrTriggerSearch({ seriesId: args.seriesId as number | undefined, }).then(wrapResponse) ); - src/arr/client.ts:159-172 (helper)Low-level API client methods: triggerSeriesSearch (POST /command with name 'SeriesSearch') and triggerMissingSearch (POST /command with name 'MissingEpisodeSearch') used by the handler.
async triggerSeriesSearch(seriesId: number): Promise<{ id: number }> { const { data } = await this.http.post<{ id: number }>("/command", { name: "SeriesSearch", seriesId, }); return data; } async triggerMissingSearch(): Promise<{ id: number }> { const { data } = await this.http.post<{ id: number }>("/command", { name: "MissingEpisodeSearch", }); return data; }