"""
Tools for api-uptime-monitor-with-alerti agent.
"""

TOOLS = [
    {
        "name": "check_endpoint",
        "desc": "Check HTTP endpoint health",
        "handler": "lambda a: 'Endpoint OK'"
    },
    {
        "name": "check_certificate",
        "desc": "Check SSL certificate expiry",
        "handler": "lambda a: 'Cert OK'"
    },
    {
        "name": "send_alert",
        "desc": "Send alert to channel",
        "handler": "lambda a: 'Alert sent'"
    }
]

def execute_tool(name: str, args: dict) -> str:
    """Execute a tool by name with given args."""
    handlers = {"check_endpoint": lambda a: 'Endpoint OK',
    "check_certificate": lambda a: 'Cert OK',
    "send_alert": lambda a: 'Alert sent'}
    handler = handlers.get(name)
    if handler:
        return handler(args)
    return f"Unknown tool: {name}"
