{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tridenttaxis.online/mcp-schemas/estimate_fare.schema.json",
  "title": "estimate_fare",
  "description": "Estimate a taxi fare in GBP between a pickup and dropoff address in the UK using the live Argyll & Bute council tariff, vehicle rate mapping, and surcharges (airport, meet & greet, 8-seater local, pre-booking).",
  "type": "object",
  "$defs": {
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": ["pickup", "dropoff"],
      "properties": {
        "pickup": {
          "type": "string",
          "minLength": 3,
          "maxLength": 200,
          "description": "Pickup address or place name."
        },
        "dropoff": {
          "type": "string",
          "minLength": 3,
          "maxLength": 200,
          "description": "Dropoff address or place name."
        },
        "vehicleType": {
          "type": "string",
          "enum": ["saloon", "estate", "executive", "6seater", "mpv", "wav"],
          "description": "Vehicle class. Defaults to saloon. 'mpv' = 8-seater; 'wav' = wheelchair-accessible TX4."
        },
        "departAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 planned departure time (UTC)."
        },
        "meetAndGreet": {
          "type": "boolean",
          "description": "Whether an airport meet & greet is requested (+£25)."
        }
      }
    },
    "output": {
      "type": "object",
      "required": [
        "fareGBP",
        "distanceMiles",
        "durationSeconds",
        "rate",
        "airportSurchargeGBP",
        "tariffVersion"
      ],
      "properties": {
        "fareGBP": { "type": "number", "description": "Fixed-price fare in GBP." },
        "distanceMiles": { "type": "number", "description": "Driving distance in miles." },
        "durationSeconds": { "type": "number", "description": "Driving duration in seconds." },
        "rate": {
          "type": "string",
          "enum": ["day", "night", "holiday"],
          "description": "Tariff band applied."
        },
        "airportSurchargeGBP": {
          "type": "number",
          "description": "Airport pickup/drop fee already included in fareGBP."
        },
        "tariffVersion": { "type": "string", "description": "Version tag of the council tariff used." },
        "appliedRules": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Human-readable descriptions of the surcharges and multipliers applied."
        }
      }
    }
  },
  "properties": {
    "input": { "$ref": "#/$defs/input" },
    "output": { "$ref": "#/$defs/output" }
  }
}
