{
  "mcpServers": {
    "loanie": {
      "url": "https://loanie.co.nz/api/mcp",
      "name": "loanie",
      "displayName": "Loanie – NZ Mortgage & Loan Platform",
      "description": "Submit loan applications, compare NZ mortgage rates, search property addresses/values, calculate repayments, estimate break fees, and resolve invitation/referral codes — via MCP (streamable-http).",
      "version": "1.0.1",
      "transport": "streamable-http",
      "capabilities": {
        "tools": true
      },

      "policy": {
        "data_handling": "Do not request or transmit internet banking credentials. For loan applications, collect only the minimum required personal info (name, email; phone optional). Follow the website privacy policy.",
        "pii": {
          "allowed": [
            "fullName",
            "email",
            "phone",
            "propertyAddress",
            "propertyValue",
            "downPayment",
            "referralCode"
          ],
          "disallowed": [
            "bank_password",
            "internet_banking_credentials",
            "card_cvv",
            "government_id_number"
          ]
        }
      },

      "response_conventions": {
        "format": "All tools return content as text containing a JSON string (JSON.stringify). Parse the text field to access structured data.",
        "errors": {
          "shape": {
            "error": "string",
            "note": "string (optional)"
          }
        }
      },

      "docs": {
        "llms": "https://loanie.co.nz/llms.txt",
        "full": "https://loanie.co.nz/llms-full.txt",
        "skills": "https://loanie.co.nz/skills.md",
        "functionCalling": "https://loanie.co.nz/.well-known/openai-function-calling.json",
        "aiReady": "https://loanie.co.nz/en/ai-ready"
      },

      "tools": [
        {
            "name": "get_mortgage_rates",
            "description": "Get current mortgage interest rates from major New Zealand banks (ANZ, ASB, BNZ, Westpac, Kiwibank, SBS). Returns rates for various fixed terms (6 months to 5 years).",
          "hints": {
            "readOnly": true,
            "destructive": false,
            "openWorld": true
          },
          "inputSchema": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "description": "Returned as JSON string in content[0].text",
            "properties": {
              "lastUpdated": { "type": ["string", "null"] },
              "fromCache": { "type": ["boolean", "null"] },
              "rates": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "product": { "type": "string" },
                      "term": { "type": "string" },
                      "rate": { "type": "number" }
                    },
                    "required": ["product", "term", "rate"],
                    "additionalProperties": false
                  }
                }
              }
            },
            "required": ["rates"],
            "additionalProperties": true
          }
        },

        {
          "name": "search_addresses",
          "description": "Search for New Zealand property addresses by free-text query. Returns matching addresses with coordinates, suburb, city, and property IDs. Use the returned property ID with get_property_details for full information.",
          "hints": {
            "readOnly": true,
            "destructive": false,
            "openWorld": true
          },
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "Address search query, e.g. \"123 Queen Street Auckland\""
              }
            },
            "required": ["query"],
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "description": "Returned as JSON string in content[0].text",
            "properties": {
              "count": { "type": "integer" },
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "address": { "type": "string" },
                    "suburb": { "type": ["string", "null"] },
                    "city": { "type": ["string", "null"] },
                    "lat": { "type": ["number", "null"] },
                    "long": { "type": ["number", "null"] },
                    "streetNumber": { "type": ["string", "number", "null"] },
                    "street": { "type": ["string", "null"] },
                    "propertyId": { "type": ["string", "null"] }
                  },
                  "required": ["address"],
                  "additionalProperties": false
                }
              }
            },
            "required": ["count", "results"],
            "additionalProperties": false
          }
        },

        {
          "name": "get_property_details",
          "description": "Get detailed information about a New Zealand property: estimated value, bedrooms, bathrooms, floor/land area, images, and more. Provide a property ID from search_addresses, or a full address to auto-resolve.",
          "hints": {
            "readOnly": true,
            "destructive": false,
            "openWorld": true
          },
          "inputSchema": {
            "type": "object",
            "properties": {
              "propertyId": {
                "type": "string",
                "description": "Property ID from search_addresses results"
              },
              "address": {
                "type": "string",
                "description": "Full address to auto-resolve if propertyId is unavailable"
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "description": "Returned as JSON string in content[0].text. On failure, returns { error: string }.",
            "properties": {
              "error": { "type": "string" },

              "propertyId": { "type": "string" },
              "estimatedValue": { "type": ["number", "null"] },
              "estimatedRange": {
                "type": "object",
                "properties": {
                  "low": { "type": ["number", "null"] },
                  "high": { "type": ["number", "null"] }
                },
                "required": ["low", "high"],
                "additionalProperties": false
              },
              "displayValue": { "type": ["string", "null"] },
              "capitalValue": { "type": ["number", "string", "null"] },
              "bedrooms": { "type": ["number", "null"] },
              "bathrooms": { "type": ["number", "null"] },
              "carSpaces": { "type": ["number", "null"] },
              "floorArea": { "type": ["number", "null"] },
              "landArea": { "type": ["number", "null"] },
              "landUse": { "type": ["string", "null"] },
              "suburb": { "type": ["string", "null"] },
              "city": { "type": ["string", "null"] },
              "images": {
                "type": ["array", "null"],
                "items": { "type": "string" }
              }
            },
            "additionalProperties": true
          }
        },

        {
          "name": "submit_loan_application",
          "description": "Submit a mortgage or loan application to Loanie (loanie.co.nz). No account required. An expert advisor will review and follow up via email/phone. Supported types: HOME_PURCHASE, REFINANCE, INVESTMENT, BUILD_DEVELOPMENT, AUTO_LOAN, HOME_EQUITY, PERSONAL_LOAN, BUSINESS_LOAN.",
          "hints": {
            "readOnly": false,
            "destructive": false,
            "openWorld": true
          },
          "inputSchema": {
            "type": "object",
            "properties": {
              "loanType": {
                "type": "string",
                "description": "Type of loan being applied for",
                "enum": [
                  "HOME_PURCHASE",
                  "REFINANCE",
                  "INVESTMENT",
                  "BUILD_DEVELOPMENT",
                  "AUTO_LOAN",
                  "HOME_EQUITY",
                  "PERSONAL_LOAN",
                  "BUSINESS_LOAN"
                ]
              },
              "fullName": {
                "type": "string",
                "description": "Applicant's full name"
              },
              "email": {
                "type": "string",
                "description": "Applicant's email address",
                "format": "email"
              },
              "phone": {
                "type": "string",
                "description": "Applicant's phone number (NZ format preferred)"
              },
              "propertyAddress": {
                "type": "string",
                "description": "Property address (for purchase/refinance)"
              },
              "propertyValue": {
                "type": "number",
                "description": "Estimated property value in NZD",
                "exclusiveMinimum": 0
              },
              "downPayment": {
                "type": "number",
                "description": "Down payment / deposit amount in NZD",
                "minimum": 0
              },
              "referralCode": {
                "type": "string",
                "description": "Referral/invitation code if referred"
              }
            },
            "required": ["loanType", "fullName", "email"],
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "description": "Returned as JSON string in content[0].text. On failure, returns { error: string }.",
            "properties": {
              "error": { "type": "string" },
              "success": { "type": "boolean" },
              "caseNumber": { "type": "string" },
              "message": { "type": "string" },
              "nextSteps": {
                "type": "array",
                "items": { "type": "string" }
              }
            },
            "additionalProperties": true
          }
        },

        {
          "name": "estimate_break_fee",
          "description": "Calculate the estimated break fee (early repayment cost) for exiting a fixed-rate mortgage in New Zealand before the term ends.",
          "hints": {
            "readOnly": true,
            "destructive": false,
            "openWorld": true
          },
          "inputSchema": {
            "type": "object",
            "properties": {
              "bank": {
                "type": "string",
                "description": "Bank holding the mortgage",
                "enum": [
                  "ANZ",
                  "ASB",
                  "BNZ",
                  "Kiwibank",
                  "TSB",
                  "Westpac",
                  "Co-operative Bank",
                  "SBS",
                  "HSBC"
                ]
              },
              "loanAmount": {
                "type": "number",
                "description": "Outstanding loan balance in NZD",
                "exclusiveMinimum": 0
              },
              "fixedRate": {
                "type": "number",
                "description": "Current fixed interest rate as percentage, e.g. 5.99",
                "exclusiveMinimum": 0
              },
              "originalTermMonths": {
                "type": "integer",
                "description": "Original fixed term in months, e.g. 12 for 1 year",
                "exclusiveMinimum": 0
              },
              "fixedInstallment": {
                "type": "number",
                "description": "Monthly payment amount in NZD",
                "exclusiveMinimum": 0
              },
              "dateFixedTermBegan": {
                "type": "string",
                "description": "Date fixed term began (YYYY-MM-DD)"
              }
            },
            "required": [
              "bank",
              "loanAmount",
              "fixedRate",
              "originalTermMonths",
              "fixedInstallment",
              "dateFixedTermBegan"
            ],
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "description": "Returned as JSON string in content[0].text. On failure, returns { error: string, note?: string }.",
            "properties": {
              "error": { "type": "string" },
              "note": { "type": "string" },

              "breakFee": { "type": ["number", "null"] },
              "prepaymentAmount": { "type": ["number", "null"] },
              "totalPayment": { "type": ["number", "null"] },
              "calculationMethod": { "type": ["string", "null"] },
              "resultNote": { "type": ["string", "null"] }
            },
            "additionalProperties": true
          }
        },

        {
          "name": "get_invitation_info",
          "description": "Look up a Loanie referral/invitation code to see who sent it, the invitation type, attached property info, and assigned expert advisor details.",
          "hints": {
            "readOnly": true,
            "destructive": false,
            "openWorld": true
          },
          "inputSchema": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "The invitation/referral code to look up"
              }
            },
            "required": ["code"],
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "description": "Returned as JSON string in content[0].text. On failure, returns { error: string }.",
            "properties": {
              "error": { "type": "string" },

              "code": { "type": "string" },
              "type": { "type": ["string", "null"] },
              "status": { "type": ["string", "null"] },
              "inviterName": { "type": ["string", "null"] },
              "usedCount": { "type": ["number", "null"] },
              "property": {
                "type": ["object", "null"],
                "properties": {
                  "address": { "type": "string" },
                  "value": { "type": ["number", "null"] },
                  "bedrooms": { "type": ["number", "null"] },
                  "bathrooms": { "type": ["number", "null"] },
                  "suburb": { "type": ["string", "null"] },
                  "city": { "type": ["string", "null"] }
                },
                "required": ["address"],
                "additionalProperties": false
              },
              "expert": {
                "type": ["object", "null"],
                "properties": {
                  "name": { "type": "string" },
                  "title": { "type": ["string", "null"] }
                },
                "required": ["name"],
                "additionalProperties": false
              },
              "applyUrl": { "type": ["string", "null"] }
            },
            "additionalProperties": true
          }
        },

        {
          "name": "calculate_repayment",
          "description": "Calculate monthly/fortnightly/weekly mortgage repayment for a given loan principal, annual interest rate, and term. Returns total interest and total cost of the loan.",
          "hints": {
            "readOnly": true,
            "destructive": false,
            "openWorld": false
          },
          "inputSchema": {
            "type": "object",
            "properties": {
              "principal": {
                "type": "number",
                "description": "Loan amount in NZD (e.g. 600000)",
                "exclusiveMinimum": 0
              },
              "annualRate": {
                "type": "number",
                "description": "Annual interest rate as percentage (e.g. 5.99)",
                "exclusiveMinimum": 0
              },
              "termYears": {
                "type": "integer",
                "description": "Loan term in years (e.g. 30)",
                "exclusiveMinimum": 0
              }
            },
            "required": ["principal", "annualRate", "termYears"],
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "description": "Returned as JSON string in content[0].text",
            "properties": {
              "monthlyPayment": { "type": "number" },
              "fortnightlyPayment": { "type": "number" },
              "weeklyPayment": { "type": "number" },
              "totalInterest": { "type": "number" },
              "totalCost": { "type": "number" },
              "principal": { "type": "number" },
              "annualRate": { "type": "number" },
              "termYears": { "type": "integer" }
            },
            "required": [
              "monthlyPayment",
              "fortnightlyPayment",
              "weeklyPayment",
              "totalInterest",
              "totalCost",
              "principal",
              "annualRate",
              "termYears"
            ],
            "additionalProperties": false
          }
        }
      ]
    },
    "calculate_borrowing_capacity": {
      "description": "Estimate how much a person can borrow for a NZ home loan based on income, expenses, dependants, and deposit. Uses a stress-test rate (current best rate + 2.5%) and standard NZ tax brackets.",
      "annotations": {
        "title": "Calculate Borrowing Capacity",
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "annualIncome": {
            "type": "number",
            "description": "Total annual income before tax in NZD"
          },
          "otherAnnualIncome": {
            "type": "number",
            "description": "Other annual income (rental, benefits, investments) in NZD",
            "default": 0
          },
          "dependants": {
            "type": "integer",
            "description": "Number of dependant children under 18",
            "default": 0
          },
          "monthlyExpenses": {
            "type": "number",
            "description": "Total monthly living expenses in NZD"
          },
          "monthlyExistingLoans": {
            "type": "number",
            "description": "Monthly existing loan repayments in NZD",
            "default": 0
          },
          "deposit": {
            "type": "number",
            "description": "Total deposit / savings available in NZD"
          },
          "termYears": {
            "type": "integer",
            "description": "Loan term in years (default 30)",
            "default": 30
          },
          "referralCode": {
            "type": "string",
            "description": "Referral/invitation code if referred by an advisor"
          }
        },
        "required": ["annualIncome", "monthlyExpenses", "deposit"],
        "additionalProperties": false
      },
      "responseConvention": [
        {
          "contentType": "text",
          "schema": {
            "type": "object",
            "properties": {
              "maxBorrowing": { "type": "number" },
              "estimatedMonthlyRepayment": { "type": "number" },
              "maxPropertyValue": { "type": "number" },
              "lvrPercent": { "type": "integer" },
              "deposit": { "type": "number" },
              "currentBestRate": { "type": "number" },
              "stressTestRate": { "type": "number" },
              "termYears": { "type": "integer" },
              "calculatorUrl": { "type": "string" }
            },
            "required": [
              "maxBorrowing",
              "estimatedMonthlyRepayment",
              "maxPropertyValue",
              "lvrPercent",
              "deposit",
              "currentBestRate",
              "stressTestRate",
              "termYears",
              "calculatorUrl"
            ],
            "additionalProperties": false
          }
        }
      ]
    }
  }
}
