{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/racecalendar-app/json-schema/racecalendar-app-mcp-history-search-payload-schema.json",
  "title": "McpHistorySearchPayload",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/racecalendar-app-openapi.yml#/components/schemas/McpHistorySearchPayload",
  "type": "object",
  "properties": {
    "generatedAt": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/McpHistorySearchItem"
      },
      "maxItems": 20
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "query": {
      "type": "string"
    },
    "sourceUpdatedAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "types": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "driver",
          "team",
          "circuit",
          "race"
        ]
      }
    }
  },
  "required": [
    "generatedAt",
    "items",
    "nextCursor",
    "query",
    "sourceUpdatedAt",
    "types"
  ],
  "$defs": {
    "McpHistorySearchItem": {
      "type": "object",
      "properties": {
        "bestChampionshipPosition": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "exclusiveMinimum": true
        },
        "firstYear": {
          "type": "integer"
        },
        "id": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "lastYear": {
          "type": "integer"
        },
        "match": {
          "type": "string",
          "enum": [
            "exact",
            "prefix",
            "substring"
          ]
        },
        "metadata": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "type": {
          "type": "string",
          "enum": [
            "driver",
            "team",
            "circuit",
            "race"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "bestChampionshipPosition",
        "firstYear",
        "id",
        "label",
        "lastYear",
        "match",
        "metadata",
        "sourceUrl",
        "type",
        "url"
      ]
    }
  }
}