#!/usr/bin/env python3
import asyncio
from contas_mcp.servers.contas_mcp_server.main import ToolCall, call_tool, health

CASES = [
    ("consultar_faturas", {"msisdn": "11999999999"}),
    ("invoice_explanation", {"msisdn": "11999999999"}),
    ("consultar_vas", {"msisdn": "11999999999"}),
    ("consultar_historico_vas", {"msisdn": "11999999999"}),
    ("cancelar_vas_avulso", {"msisdn": "11999999999", "subject": "TIM Fashion Mensal"}),
    ("contestar_cobranca", {"msisdn": "11999999999", "subject": "Tamboro Mensal", "valor": 14.99, "motivo": "não reconheço"}),
]

async def main():
    print(await health())
    for name, arguments in CASES:
        result = await call_tool(ToolCall(tool_name=name, arguments=arguments))
        print(name, "OK" if result.get("ok") else "FAIL")
        if not result.get("ok"):
            raise SystemExit(result)

asyncio.run(main())
