{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tridenttaxis.online/mcp-schemas/start_booking.schema.json",
  "title": "start_booking",
  "description": "Build a prefilled booking URL with a live fare quote embedded in the query string. Does NOT confirm a booking — the passenger completes name, phone, date and payment on the site.",
  "type": "object",
  "$defs": {
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": ["pickup", "dropoff", "vehicleType"],
      "properties": {
        "pickup": { "type": "string", "minLength": 3, "maxLength": 200 },
        "dropoff": { "type": "string", "minLength": 3, "maxLength": 200 },
        "vehicleType": {
          "type": "string",
          "enum": ["saloon", "mpv", "wav"],
          "description": "saloon (≤4), mpv (8-seater, ≤7), wav (TX4 wheelchair-accessible)."
        },
        "departAt": { "type": "string", "format": "date-time" },
        "meetAndGreet": { "type": "boolean" },
        "passengers": { "type": "integer", "minimum": 1, "maximum": 8 }
      }
    },
    "output": {
      "type": "object",
      "required": [
        "bookingUrl",
        "confirmed",
        "requiresPassengerAction",
        "quote",
        "prefilled"
      ],
      "properties": {
        "bookingUrl": { "type": "string", "format": "uri" },
        "confirmed": { "type": "boolean", "const": false },
        "requiresPassengerAction": { "type": "boolean", "const": true },
        "quote": {
          "type": "object",
          "required": [
            "fareGBP",
            "distanceMiles",
            "durationSeconds",
            "rate",
            "vehicleType",
            "tariffVersion"
          ],
          "properties": {
            "fareGBP": { "type": "number" },
            "distanceMiles": { "type": "number" },
            "durationSeconds": { "type": "number" },
            "rate": { "type": "string", "enum": ["day", "night", "holiday"] },
            "vehicleType": { "type": "string", "enum": ["saloon", "mpv", "wav"] },
            "tariffVersion": { "type": "string" }
          }
        },
        "prefilled": {
          "type": "object",
          "required": ["pickup", "dropoff", "vehicleType", "departAt", "meetAndGreet"],
          "properties": {
            "pickup": { "type": "string" },
            "dropoff": { "type": "string" },
            "vehicleType": { "type": "string", "enum": ["saloon", "mpv", "wav"] },
            "departAt": { "type": ["string", "null"], "format": "date-time" },
            "meetAndGreet": { "type": "boolean" }
          }
        }
      }
    }
  },
  "properties": {
    "input": { "$ref": "#/$defs/input" },
    "output": { "$ref": "#/$defs/output" }
  }
}
