{
  "x402Version": 2,
  "service": "mail-preflight",
  "title": "MailPreflight Email QA & Deliverability API",
  "version": "1.0.0",
  "mcpEndpoint": "https://mail-preflight.apikeg.com/mcp",
  "freeDiscovery": [
    "https://mail-preflight.apikeg.com/llms.txt",
    "https://mail-preflight.apikeg.com/llms-full.txt",
    "https://mail-preflight.apikeg.com/openapi.json",
    "https://mail-preflight.apikeg.com/.well-known/mcp.json",
    "https://mail-preflight.apikeg.com/.well-known/api-catalog"
  ],
  "resources": [
    {
      "name": "audit_email_template",
      "title": "Audit Outbound Email Template",
      "url": "https://mail-preflight.apikeg.com/v1/audit-email-template",
      "method": "POST",
      "description": "Runs a full pre-send deliverability, merge-tag, link-hygiene, Gmail 102KB clipping, and cross-client CSS compatibility audit (Outlook Windows, Gmail, Apple Mail Dark Mode) on an HTML email. Why call instead of DIY: Audits 30+ email-client CSS quirks, 6 ESP merge syntaxes, and phishing/spam heuristics in <10ms for $0.003 without maintaining Can-I-Email rulesets. Pricing: $0.003 USD per email template preflight audit (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "3000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.003",
            "unitDescription": "per email template preflight audit",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "marketing-ops",
            "email-deliverability",
            "developer-tools",
            "revops"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "subject": "Welcome to Acme, {{first_name}}!",
                "preheader": "Your workspace is provisioned.",
                "emailCategory": "marketing",
                "html": "<!DOCTYPE html><html><head><meta name=\"color-scheme\" content=\"light dark\"></head><body style=\"background-color:#f9fafb;\"><p>Hi there, <a href=\"https://acme.com/start\">Launch Workspace</a> · <a href=\"https://acme.com/unsubscribe\">Unsubscribe</a></p></body></html>"
              }
            },
            "output": {
              "type": "json",
              "summary": "Flags unmerged {{first_name}} in subject as blocked with prioritized actionableFixes."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "html": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 900000,
                  "description": "Complete outbound HTML email payload to inspect for Gmail 102KB clipping, Outlook/Gmail/Dark Mode CSS support, link hygiene, and spam triggers."
                },
                "subject": {
                  "type": "string",
                  "maxLength": 998,
                  "description": "Optional Subject header evaluated for unmerged placeholders, fake Re:/Fwd: prefixes, ALL-CAPS shouting, and punctuation triggers."
                },
                "preheader": {
                  "type": "string",
                  "maxLength": 1000,
                  "description": "Optional preview/preheader snippet checked for unmerged merge tags and spam triggers."
                },
                "plainText": {
                  "type": "string",
                  "maxLength": 500000,
                  "description": "Optional text/plain MIME companion body checked for unmerged placeholders and unsubscribe compliance."
                },
                "emailCategory": {
                  "type": "string",
                  "enum": [
                    "transactional",
                    "marketing",
                    "cold_outreach"
                  ],
                  "default": "transactional",
                  "description": "Outbound email class controlling compliance rules (marketing and cold_outreach require an unsubscribe mechanism)."
                }
              },
              "required": [
                "html"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "name": "extract_plain_text_fallback",
      "title": "Extract Plain-Text MIME Fallback",
      "url": "https://mail-preflight.apikeg.com/v1/extract-plain-text-fallback",
      "method": "POST",
      "description": "Converts an HTML email into a clean, RFC 5322-wrapped text/plain MIME companion, preserving CTA links inline as 'Label (https://...)' and stripping invisible &#847; / &zwnj; preheader padding hacks. Why call instead of DIY: Strips email-specific &zwnj;/&#847; preheader spacers and formats multi-column/CTA HTML cleanly in <5ms for $0.001 instead of naive strip-tags regexes. Pricing: $0.001 USD per HTML-to-plain-text MIME fallback conversion (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "1000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.001",
            "unitDescription": "per HTML-to-plain-text MIME fallback conversion",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "marketing-ops",
            "email-deliverability",
            "developer-tools",
            "revops"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "html": "<div>Preview text &zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;</div><h1>Payment Received</h1><p>View your invoice: <a href=\"https://acme.com/inv/42\">Download PDF</a></p>",
                "wrapWidth": 78
              }
            },
            "output": {
              "type": "json",
              "summary": "Returns clean wrapped text with 'Download PDF (https://acme.com/inv/42)' and zero invisible spacer characters."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "html": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 900000,
                  "description": "HTML email body to convert into a formatted text/plain MIME fallback with inline CTA URLs and stripped preheader padding."
                },
                "wrapWidth": {
                  "type": "integer",
                  "minimum": 40,
                  "maximum": 120,
                  "default": 78,
                  "description": "Soft line-wrap width in characters (default 78 per RFC 5322; URLs are never split)."
                }
              },
              "required": [
                "html"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}