{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "name": "FeeFlow Payment Fee Engine MCP",
  "description": "Model Context Protocol (MCP) tool definitions enabling AI models to calculate merchant transaction fees, invoice gross-ups, and gateway cost comparisons.",
  "version": "1.0.0",
  "tools": [
    {
      "name": "calculate_payment_fee",
      "description": "Calculate exact payment gateway deductions, interchange fees, statutory caps, and net payout or required gross charge.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "The invoice or transaction amount"
          },
          "gateway": {
            "type": "string",
            "description": "Payment processor name (stripe, paypal, square, ach, razorpay, mada, pix, gocardless, mollie, paystack)",
            "default": "stripe"
          },
          "country": {
            "type": "string",
            "description": "Country ISO code (us, ca, gb, in, sa, br, etc.)",
            "default": "us"
          },
          "mode": {
            "type": "string",
            "enum": ["net", "gross"],
            "description": "'net' calculates what you take home; 'gross' calculates what to invoice client so you take home target net.",
            "default": "net"
          }
        },
        "required": ["amount"]
      }
    },
    {
      "name": "get_cheapest_payment_gateway",
      "description": "Rank and identify the lowest-cost payment method for a specific transaction amount in a given country.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "The transaction amount to evaluate"
          },
          "country": {
            "type": "string",
            "description": "Country code (us, gb, ca, au, in, sa, br, mx, ng, etc.)",
            "default": "us"
          }
        },
        "required": ["amount", "country"]
      }
    }
  ]
}
