{
  "name": "email-validate",
  "summary": "Validates an email address: syntax, MX records for its domain, and whether it is a disposable or role account.",
  "rationale": "The MX check needs a resolver an agent may not have, and the disposable/role assessment is a curated dataset and rule set it would otherwise have to build and keep current.",
  "family": "domain",
  "price_usd": "0.002",
  "free": false,
  "timeout_ms": 5000,
  "max_timeout_seconds": 26,
  "input_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "email": {
        "type": "string",
        "minLength": 1,
        "maxLength": 320,
        "description": "The address to assess, up to 320 characters; it is trimmed, and a malformed address is answered with syntax_valid false rather than rejected."
      },
      "check_mx": {
        "default": true,
        "description": "Whether to resolve MX records for the domain; when true, a domain with no MX makes valid false, and false skips every network lookup.",
        "type": "boolean"
      },
      "check_disposable": {
        "default": true,
        "description": "Whether to match the domain against the bundled disposable-provider list; when true, a disposable domain makes valid false.",
        "type": "boolean"
      }
    },
    "required": [
      "email"
    ],
    "additionalProperties": false
  },
  "input_example": {
    "email": "support@grist.tools",
    "check_mx": false
  },
  "output_example": {
    "email": "support@grist.tools",
    "valid": true,
    "syntax_valid": true,
    "mx_found": false,
    "mx_records": [],
    "is_disposable": false,
    "is_role_account": true
  },
  "errors": [
    "invalid_input",
    "unreachable_target",
    "upstream_timeout",
    "internal"
  ]
}