sonarr_get_health
Check Sonarr health status to identify warnings and issues detected by the TV show management application.
Instructions
Get health check warnings and issues from Sonarr (TV). Shows any problems detected by the application.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:830-853 (handler)Primary handler for the sonarr_get_health tool. Matches the tool name in the switch statement, retrieves the SonarrClient instance, calls getHealth(), and formats the response as structured JSON with issue count, details, and status.case "sonarr_get_health": case "radarr_get_health": case "lidarr_get_health": case "readarr_get_health": { const serviceName = name.split('_')[0] as keyof typeof clients; const client = clients[serviceName]; if (!client) throw new Error(`${serviceName} not configured`); const health = await client.getHealth(); return { content: [{ type: "text", text: JSON.stringify({ issueCount: health.length, issues: health.map(h => ({ source: h.source, type: h.type, message: h.message, wikiUrl: h.wikiUrl, })), status: health.length === 0 ? 'healthy' : 'issues detected', }, null, 2), }], }; }
- src/index.ts:118-125 (schema)Tool schema definition for sonarr_get_health (and similar tools). Defines the name, description, and empty input schema (no parameters required). This is pushed to the TOOLS array dynamically when Sonarr is configured.name: `${serviceName}_get_health`, description: `Get health check warnings and issues from ${displayName}. Shows any problems detected by the application.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, },
- src/index.ts:174-178 (registration)Registration of configuration tools including sonarr_get_health. Calls addConfigTools('sonarr', ...) if Sonarr client is configured, which adds the tool to the global TOOLS array used for MCP tool listing.// Add config tools for each configured service (except Prowlarr which has different config) if (clients.sonarr) addConfigTools('sonarr', 'Sonarr (TV)'); if (clients.radarr) addConfigTools('radarr', 'Radarr (Movies)'); if (clients.lidarr) addConfigTools('lidarr', 'Lidarr (Music)'); if (clients.readarr) addConfigTools('readarr', 'Readarr (Books)');
- src/arr-client.ts:561-566 (helper)Core implementation of health check retrieval in ArrClient base class (inherited by SonarrClient). Makes authenticated GET request to the /health API endpoint and returns array of HealthCheck objects./** * Get health check issues */ async getHealth(): Promise<HealthCheck[]> { return this.request<HealthCheck[]>('/health'); }
- src/arr-client.ts:592-595 (helper)SonarrClient class definition, which extends ArrClient and thus inherits the getHealth method used by the tool handler.export class SonarrClient extends ArrClient { constructor(config: ArrConfig) { super('sonarr', config); }