{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/racecalendar-app/json-schema/racecalendar-app-mcp-competitor-comparison-payload-schema.json",
  "title": "McpCompetitorComparisonPayload",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/racecalendar-app-openapi.yml#/components/schemas/McpCompetitorComparisonPayload",
  "type": "object",
  "properties": {
    "comparison": {
      "type": "object",
      "properties": {
        "pointsDifference": {
          "type": "number"
        },
        "positionAdvantage": {
          "type": "number"
        },
        "winsDifference": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "pointsDifference",
        "positionAdvantage",
        "winsDifference"
      ]
    },
    "generatedAt": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "driver",
        "constructor"
      ]
    },
    "leader": {
      "type": "string",
      "enum": [
        "left",
        "right",
        "tie"
      ]
    },
    "left": {
      "$ref": "#/$defs/McpCompetitorSummary"
    },
    "methodology": {
      "type": "string"
    },
    "right": {
      "$ref": "#/$defs/McpCompetitorSummary"
    },
    "source": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "label",
        "updatedAt",
        "url"
      ]
    },
    "year": {
      "type": "integer"
    }
  },
  "required": [
    "comparison",
    "generatedAt",
    "kind",
    "leader",
    "left",
    "methodology",
    "right",
    "source",
    "year"
  ],
  "$defs": {
    "McpCompetitorSummary": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "nationality": {
          "type": [
            "string",
            "null"
          ]
        },
        "points": {
          "type": "number"
        },
        "position": {
          "type": "integer"
        },
        "teams": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "wins": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "nationality",
        "points",
        "position",
        "teams",
        "wins"
      ]
    }
  }
}