get_server_status
Check Radarr and Sonarr server status and connectivity to monitor media management system availability.
Instructions
Check the status and connectivity of Radarr and Sonarr servers.
Returns: Status information for both servers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/arr_assistant_mcp/main.py:480-499 (handler)The main handler function for the get_server_status tool. Instantiates MediaServerAPI and retrieves status from Radarr and Sonarr servers.async def get_server_status() -> Dict[str, Any]: """ Check the status and connectivity of Radarr and Sonarr servers. Returns: Status information for both servers """ if not config: return {"error": "Server not configured"} api = MediaServerAPI(config) radarr_status = await api.check_radarr_status() sonarr_status = await api.check_sonarr_status() return { "radarr": radarr_status, "sonarr": sonarr_status, "timestamp": datetime.now().isoformat() }
- src/arr_assistant_mcp/main.py:479-479 (registration)FastMCP decorator that registers the get_server_status function as a tool.@mcp.tool
- Helper method in MediaServerAPI class that checks Radarr server status via its API.async def check_radarr_status(self) -> Dict[str, Any]: """Check Radarr server status""" url = f"{self.config.radarr_url}/api/v3/system/status" headers = {"X-Api-Key": self.config.radarr_api_key} try: response = await self.client.get(url, headers=headers) response.raise_for_status() return {"status": "connected", "data": response.json()} except Exception as e: return {"status": "error", "message": str(e)}
- Helper method in MediaServerAPI class that checks Sonarr server status via its API.async def check_sonarr_status(self) -> Dict[str, Any]: """Check Sonarr server status""" url = f"{self.config.sonarr_url}/api/v3/system/status" headers = {"X-Api-Key": self.config.sonarr_api_key} try: response = await self.client.get(url, headers=headers) response.raise_for_status() return {"status": "connected", "data": response.json()} except Exception as e: return {"status": "error", "message": str(e)}