sonarr_search_episode
Search for specific TV episodes using their episode IDs to locate and download content through Sonarr media management.
Instructions
Trigger a search for specific episode(s)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| episodeIds | Yes | Episode ID(s) to search for |
Implementation Reference
- src/arr-client.ts:662-670 (handler)Core implementation of sonarr_search_episode: Posts 'EpisodeSearch' command to Sonarr API with episode IDs.async searchEpisode(episodeIds: number[]): Promise<{ id: number }> { return this['request']<{ id: number }>('/command', { method: 'POST', body: JSON.stringify({ name: 'EpisodeSearch', episodeIds, }), }); }
- src/index.ts:262-275 (registration)Tool registration in TOOLS array, including name, description, and input schema definition.name: "sonarr_search_episode", description: "Trigger a search for specific episode(s)", inputSchema: { type: "object" as const, properties: { episodeIds: { type: "array", items: { type: "number" }, description: "Episode ID(s) to search for", }, }, required: ["episodeIds"], }, }
- src/index.ts:1171-1185 (handler)MCP server dispatch handler that validates Sonarr config, extracts arguments, calls SonarrClient.searchEpisode, and formats response.case "sonarr_search_episode": { if (!clients.sonarr) throw new Error("Sonarr not configured"); const episodeIds = (args as { episodeIds: number[] }).episodeIds; const result = await clients.sonarr.searchEpisode(episodeIds); return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Search triggered for ${episodeIds.length} episode(s)`, commandId: result.id, }, null, 2), }], }; }