"""
Monitoring and diagnostics tools
"""

from mcp.types import Tool


def get_monitoring_tools():
    """Return tools for monitoring and diagnostics."""
    return [
        Tool(
            name="get_system_health",
            description="Get comprehensive system health report with status of all components",
            inputSchema={
                "type": "object",
                "properties": {
                    "detailed": {
                        "type": "boolean",
                        "description": "Include detailed information for each component",
                        "default": False,
                    }
                },
            },
        ),
        Tool(
            name="get_performance_metrics",
            description="Get detailed performance metrics and statistics",
            inputSchema={
                "type": "object",
                "properties": {
                    "time_range": {
                        "type": "string",
                        "description": "Time range for metrics (e.g., '1h', '24h', '7d')",
                        "default": "1h",
                    },
                    "include_histogram": {
                        "type": "boolean",
                        "description": "Include detailed histogram data",
                        "default": False,
                    },
                },
            },
        ),
        Tool(
            name="get_cache_stats",
            description="Get detailed cache statistics and performance",
            inputSchema={
                "type": "object",
                "properties": {
                    "include_keys": {
                        "type": "boolean",
                        "description": "Include sample cache keys (for debugging)",
                        "default": False,
                    }
                },
            },
        ),
        Tool(
            name="clear_cache",
            description="Clear all cache entries or specific cache type",
            inputSchema={
                "type": "object",
                "properties": {
                    "cache_type": {
                        "type": "string",
                        "description": "Type of cache to clear ('all', 'http', 'response')",
                        "default": "all",
                    }
                },
            },
        ),
        Tool(
            name="get_connection_stats",
            description="Get connection pool and HTTP client statistics",
            inputSchema={"type": "object", "properties": {}},
        ),
        Tool(
            name="run_diagnostic",
            description="Run comprehensive diagnostic check on all system components",
            inputSchema={
                "type": "object",
                "properties": {
                    "component": {
                        "type": "string",
                        "description": "Specific component to diagnose or 'all' for full diagnostic",
                        "default": "all",
                    },
                    "verbose": {
                        "type": "boolean",
                        "description": "Include verbose diagnostic information",
                        "default": False,
                    },
                },
            },
        ),
    ]
