sonarr_get_health
Check Sonarr for health warnings and issues to identify problems 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:174-179 (registration)Conditional registration of configuration tools including "sonarr_get_health" via addConfigTools call for Sonarr.// 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/index.ts:118-125 (schema)Tool schema definition for sonarr_get_health (and similar) within addConfigTools function. Defines name, description, and empty input schema.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:830-853 (handler)Primary handler for sonarr_get_health tool. Extracts service name, retrieves client instance, calls client.getHealth(), formats health checks response with issue count and details.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:67-86 (helper)Initialization of SonarrClient instance stored in clients.sonarr, required for tool execution.for (const service of configuredServices) { const config = { url: service.url!, apiKey: service.apiKey! }; switch (service.name) { case 'sonarr': clients.sonarr = new SonarrClient(config); break; case 'radarr': clients.radarr = new RadarrClient(config); break; case 'lidarr': clients.lidarr = new LidarrClient(config); break; case 'readarr': clients.readarr = new ReadarrClient(config); break; case 'prowlarr': clients.prowlarr = new ProwlarrClient(config); break; } }
- src/arr-client.ts:564-566 (helper)Core getHealth method in ArrClient (inherited by SonarrClient) that makes API request to /health endpoint.async getHealth(): Promise<HealthCheck[]> { return this.request<HealthCheck[]>('/health'); }