{
  "openapi": "3.1.0",
  "info": {
    "title": "Comperatore Seguros Agent API",
    "version": "1.0.0",
    "description": "Public API for AI agents to request car insurance quotes and site health from Mauricio Comperatore (PAS Matrícula SSN N° 51526) in Mendoza, Argentina.",
    "contact": {
      "name": "Mauricio Comperatore",
      "url": "https://www.comperatoreseguros.com",
      "email": "consultas@comperatoreseguros.com"
    }
  },
  "servers": [
    { "url": "https://www.comperatoreseguros.com" }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "Service healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string" },
                    "service": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/cotizar": {
      "post": {
        "operationId": "cotizarAutomotor",
        "summary": "Submit an automotor quote request",
        "description": "Creates a structured quote lead for Mauricio Comperatore. Returns a WhatsApp deep link and confirmation id. Does not bind coverage.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CotizarRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quote lead accepted",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CotizarResponse" }
              }
            }
          },
          "400": { "description": "Invalid payload" }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP Streamable HTTP endpoint",
        "responses": {
          "200": { "description": "MCP JSON-RPC response" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CotizarRequest": {
        "type": "object",
        "required": ["marca", "modelo", "anio", "localidad"],
        "properties": {
          "marca": { "type": "string", "example": "Ford" },
          "modelo": { "type": "string", "example": "Ranger XLT" },
          "anio": { "type": "integer", "example": 2007 },
          "version": { "type": "string" },
          "uso": { "type": "string", "enum": ["particular", "comercial"], "default": "particular" },
          "localidad": { "type": "string", "example": "Mendoza" },
          "nombre": { "type": "string" },
          "telefono": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "notas": { "type": "string" }
        }
      },
      "CotizarResponse": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "id": { "type": "string" },
          "whatsapp_url": { "type": "string", "format": "uri" },
          "message": { "type": "string" },
          "cite": { "type": "string", "format": "uri" }
        }
      }
    }
  }
}
