INNER CODE UNIT · Python
health_check
Spoofkapoof/TradingViewMCPServer · tradingview_mcp/server.py:208
def health_check() -> dict:
"""
Check server health and API connectivity status.
Returns:
Server health information including version, cache stats, and API status
"""
# Check API key configuration
api_key_configured = bool(api_client.api_key)
# Get cache statistics
cache_stats = api_client.cache.get_stats()
# Server version (from pyproject.toml)
version = "3.3.0"
return {
"status": "healthy" if api_key_configured else "degraded",