{
    "openapi": "3.1.0",
    "info": {
        "title": "Harness Racing API",
        "version": "1",
        "description": "Trot and pace racing data. Full documentation: https://harnessracingapi.com/documentation"
    },
    "servers": [
        {
            "url": "https://api.harnessracingapi.com"
        }
    ],
    "security": [
        {
            "key": []
        },
        {
            "bearer": []
        }
    ],
    "components": {
        "securitySchemes": {
            "key": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            },
            "bearer": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    },
    "paths": {
        "/v1/countries": {
            "get": {
                "operationId": "countries",
                "summary": "List countries",
                "description": "Every country we hold, with the date its results start, how far back it is still being read, and what its results carry.",
                "tags": [
                    "Reference"
                ],
                "x-plan": "free",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "code": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Country"
                                                    },
                                                    "from": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "First result held"
                                                    },
                                                    "filling_to": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "How far back the history is being read, null when complete"
                                                    },
                                                    "races": {
                                                        "type": "integer",
                                                        "description": "Races held"
                                                    },
                                                    "racecourses": {
                                                        "type": "integer",
                                                        "description": "Racecourses with results"
                                                    },
                                                    "every_runner": {
                                                        "type": "boolean",
                                                        "description": "Results carry every runner, not only the winner"
                                                    },
                                                    "last_result": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "When the newest result landed, UTC"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "list_countries"
            }
        },
        "/v1/countries/{code}": {
            "get": {
                "operationId": "country",
                "summary": "One country",
                "description": "One country in full, with its racecourses and how fresh its results are.",
                "tags": [
                    "Reference"
                ],
                "x-plan": "free",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "description": "Country code, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "description": "Country code"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "description": "Country"
                                                },
                                                "from": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "First result held"
                                                },
                                                "filling_to": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "How far back the history is being read, null when complete"
                                                },
                                                "races": {
                                                    "type": "integer",
                                                    "description": "Races held"
                                                },
                                                "racecourses": {
                                                    "type": "integer",
                                                    "description": "Racecourses with results"
                                                },
                                                "every_runner": {
                                                    "type": "boolean",
                                                    "description": "Results carry every runner, not only the winner"
                                                },
                                                "last_result": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "When the newest result landed, UTC"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/racecourses": {
            "get": {
                "operationId": "racecourses",
                "summary": "List racecourses",
                "description": "Every racecourse with results, by country.",
                "tags": [
                    "Reference"
                ],
                "x-plan": "free",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our racecourse id"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Racecourse name"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "surface": {
                                                        "type": "string",
                                                        "description": "cinder, sand or grass"
                                                    },
                                                    "circuit_m": {
                                                        "type": "integer",
                                                        "description": "One lap in metres"
                                                    },
                                                    "races": {
                                                        "type": "integer",
                                                        "description": "Races held"
                                                    },
                                                    "first": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "First result held"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/racecourses/{id}": {
            "get": {
                "operationId": "racecourse",
                "summary": "One racecourse",
                "description": "One racecourse, its circuit and how many races we hold there.",
                "tags": [
                    "Reference"
                ],
                "x-plan": "free",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The racecourse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Our racecourse id"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "description": "Racecourse name"
                                                },
                                                "country": {
                                                    "type": "string",
                                                    "description": "Country code"
                                                },
                                                "surface": {
                                                    "type": "string",
                                                    "description": "cinder, sand or grass"
                                                },
                                                "circuit_m": {
                                                    "type": "integer",
                                                    "description": "One lap in metres"
                                                },
                                                "races": {
                                                    "type": "integer",
                                                    "description": "Races held"
                                                },
                                                "first": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "First result held"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/usage": {
            "get": {
                "operationId": "usage",
                "summary": "Your usage",
                "description": "Your plan, calls today, your limits and when they reset. It never counts against your allowance.",
                "tags": [
                    "Reference"
                ],
                "x-plan": "account",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "plan": {
                                                    "type": "string",
                                                    "description": "Your plan"
                                                },
                                                "calls_today": {
                                                    "type": "integer",
                                                    "description": "Calls since 00:00 UTC"
                                                },
                                                "day_limit": {
                                                    "type": "integer",
                                                    "description": "Calls a day"
                                                },
                                                "minute_limit": {
                                                    "type": "integer",
                                                    "description": "Calls a minute"
                                                },
                                                "resets_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "When the day count resets, UTC"
                                                },
                                                "window": {
                                                    "type": "object",
                                                    "description": "The days your plan reads"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/status": {
            "get": {
                "operationId": "status",
                "summary": "API status",
                "description": "Whether results are arriving, country by country, and when each last landed.",
                "tags": [
                    "Reference"
                ],
                "x-plan": "free",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "state": {
                                                    "type": "string",
                                                    "description": "up, slow or down"
                                                },
                                                "countries": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Each country with its last result and today's count"
                                                },
                                                "checked_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "When this was built, UTC"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/meetings": {
            "get": {
                "operationId": "meetings",
                "summary": "List meetings",
                "description": "Race meetings by day and country, with their race counts and first start.",
                "tags": [
                    "Meetings and racecards"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "A day, YYYY-MM-DD, or today, yesterday",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our meeting id"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "The racecourse's own day"
                                                    },
                                                    "races": {
                                                        "type": "integer",
                                                        "description": "Races on the card"
                                                    },
                                                    "first_off": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "First race, UTC"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "scheduled, racing, finished"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/meetings/{id}": {
            "get": {
                "operationId": "meeting",
                "summary": "One meeting",
                "description": "One meeting with every race on its card.",
                "tags": [
                    "Meetings and racecards"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The meeting id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Our meeting id"
                                                },
                                                "country": {
                                                    "type": "string",
                                                    "description": "Country code"
                                                },
                                                "racecourse": {
                                                    "type": "object",
                                                    "description": "Racecourse id and name"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "The racecourse's own day"
                                                },
                                                "races": {
                                                    "type": "integer",
                                                    "description": "Races on the card"
                                                },
                                                "first_off": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "First race, UTC"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "description": "scheduled, racing, finished"
                                                },
                                                "card": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Its races, in order"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/racecards": {
            "get": {
                "operationId": "racecards",
                "summary": "Racecards",
                "description": "Races coming up with every declared runner, driver, trainer and starting position.",
                "tags": [
                    "Meetings and racecards"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "A day, YYYY-MM-DD, or today, yesterday",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "racecourse",
                        "in": "query",
                        "required": false,
                        "description": "A racecourse id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our race id"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "The racecourse's own day"
                                                    },
                                                    "off": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time in UTC"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Race number on the day"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Race name"
                                                    },
                                                    "distance_m": {
                                                        "type": "integer",
                                                        "description": "Distance in metres"
                                                    },
                                                    "start": {
                                                        "type": "string",
                                                        "description": "autostart or standing"
                                                    },
                                                    "gait": {
                                                        "type": "string",
                                                        "description": "trot or pace"
                                                    },
                                                    "meeting": {
                                                        "type": "string",
                                                        "description": "The meeting it is part of: its racecourse on its day"
                                                    },
                                                    "off_local": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time at the racecourse, with its UTC offset"
                                                    },
                                                    "timezone": {
                                                        "type": "string",
                                                        "description": "The racecourse's own time zone (a state's, in the US, Canada and Australia)"
                                                    },
                                                    "going": {
                                                        "type": "string",
                                                        "description": "The track's condition on the day where the source gives it: fast, wet fast, good, sloppy, muddy, slow, heavy"
                                                    },
                                                    "temperature_c": {
                                                        "type": "number",
                                                        "description": "Air temperature at the racecourse in degrees Celsius, where the source gives it"
                                                    },
                                                    "disputed": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Fields our sources disagree on with no known reason (winner, distance_m): the value shown is the best source's and is not yet settled. Empty when every source agrees"
                                                    },
                                                    "prize": {
                                                        "type": "object",
                                                        "description": "Total prize money and its currency"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "scheduled, running, final or abandoned"
                                                    },
                                                    "runners": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Declared runners"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "todays_racecards"
            }
        },
        "/v1/races/{id}": {
            "get": {
                "operationId": "race",
                "summary": "One race",
                "description": "One race, before or after the off, with every runner.",
                "tags": [
                    "Meetings and racecards"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The race id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Our race id"
                                                },
                                                "country": {
                                                    "type": "string",
                                                    "description": "Country code"
                                                },
                                                "racecourse": {
                                                    "type": "object",
                                                    "description": "Racecourse id and name"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "The racecourse's own day"
                                                },
                                                "off": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "Start time in UTC"
                                                },
                                                "number": {
                                                    "type": "integer",
                                                    "description": "Race number on the day"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "description": "Race name"
                                                },
                                                "distance_m": {
                                                    "type": "integer",
                                                    "description": "Distance in metres"
                                                },
                                                "start": {
                                                    "type": "string",
                                                    "description": "autostart or standing"
                                                },
                                                "gait": {
                                                    "type": "string",
                                                    "description": "trot or pace"
                                                },
                                                "meeting": {
                                                    "type": "string",
                                                    "description": "The meeting it is part of: its racecourse on its day"
                                                },
                                                "off_local": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "Start time at the racecourse, with its UTC offset"
                                                },
                                                "timezone": {
                                                    "type": "string",
                                                    "description": "The racecourse's own time zone (a state's, in the US, Canada and Australia)"
                                                },
                                                "going": {
                                                    "type": "string",
                                                    "description": "The track's condition on the day where the source gives it: fast, wet fast, good, sloppy, muddy, slow, heavy"
                                                },
                                                "temperature_c": {
                                                    "type": "number",
                                                    "description": "Air temperature at the racecourse in degrees Celsius, where the source gives it"
                                                },
                                                "disputed": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Fields our sources disagree on with no known reason (winner, distance_m): the value shown is the best source's and is not yet settled. Empty when every source agrees"
                                                },
                                                "prize": {
                                                    "type": "object",
                                                    "description": "Total prize money and its currency"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "description": "scheduled, running, final or abandoned"
                                                },
                                                "runners": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Every runner"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "get_race"
            }
        },
        "/v1/races/{id}/runners": {
            "get": {
                "operationId": "race_runners",
                "summary": "Runners in a race",
                "description": "Just the runners of one race, in saddle cloth order before the off, finishing order after.",
                "tags": [
                    "Meetings and racecards"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The race id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "place": {
                                                        "type": "integer",
                                                        "description": "Finishing place, null when not placed"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Saddle cloth number"
                                                    },
                                                    "post": {
                                                        "type": "integer",
                                                        "description": "Starting position"
                                                    },
                                                    "horse": {
                                                        "type": "object",
                                                        "description": "Horse id and name"
                                                    },
                                                    "driver": {
                                                        "type": "object",
                                                        "description": "Driver id and name"
                                                    },
                                                    "trainer": {
                                                        "type": "object",
                                                        "description": "Trainer id and name"
                                                    },
                                                    "km_time": {
                                                        "type": "string",
                                                        "description": "Time per km, m:ss.t"
                                                    },
                                                    "odds": {
                                                        "type": "number",
                                                        "description": "Final odds, decimal"
                                                    },
                                                    "prize": {
                                                        "type": "number",
                                                        "description": "Prize money won"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "finished, disqualified, scratched or broke"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/results": {
            "get": {
                "operationId": "results",
                "summary": "Results by day",
                "description": "Every finished race on a day, with every runner, place, km time and odds.",
                "tags": [
                    "Results"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "A day, YYYY-MM-DD, or today, yesterday",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "racecourse",
                        "in": "query",
                        "required": false,
                        "description": "A racecourse id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our race id"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "The racecourse's own day"
                                                    },
                                                    "off": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time in UTC"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Race number on the day"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Race name"
                                                    },
                                                    "distance_m": {
                                                        "type": "integer",
                                                        "description": "Distance in metres"
                                                    },
                                                    "start": {
                                                        "type": "string",
                                                        "description": "autostart or standing"
                                                    },
                                                    "gait": {
                                                        "type": "string",
                                                        "description": "trot or pace"
                                                    },
                                                    "meeting": {
                                                        "type": "string",
                                                        "description": "The meeting it is part of: its racecourse on its day"
                                                    },
                                                    "off_local": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time at the racecourse, with its UTC offset"
                                                    },
                                                    "timezone": {
                                                        "type": "string",
                                                        "description": "The racecourse's own time zone (a state's, in the US, Canada and Australia)"
                                                    },
                                                    "going": {
                                                        "type": "string",
                                                        "description": "The track's condition on the day where the source gives it: fast, wet fast, good, sloppy, muddy, slow, heavy"
                                                    },
                                                    "temperature_c": {
                                                        "type": "number",
                                                        "description": "Air temperature at the racecourse in degrees Celsius, where the source gives it"
                                                    },
                                                    "disputed": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Fields our sources disagree on with no known reason (winner, distance_m): the value shown is the best source's and is not yet settled. Empty when every source agrees"
                                                    },
                                                    "prize": {
                                                        "type": "object",
                                                        "description": "Total prize money and its currency"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "scheduled, running, final or abandoned"
                                                    },
                                                    "runners": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Every runner, in finishing order"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "get_results"
            }
        },
        "/v1/results/yesterday": {
            "get": {
                "operationId": "results_yesterday",
                "summary": "Yesterday's results",
                "description": "Every race from yesterday, at each racecourse's own day. The free key's home.",
                "tags": [
                    "Results"
                ],
                "x-plan": "free",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our race id"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "The racecourse's own day"
                                                    },
                                                    "off": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time in UTC"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Race number on the day"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Race name"
                                                    },
                                                    "distance_m": {
                                                        "type": "integer",
                                                        "description": "Distance in metres"
                                                    },
                                                    "start": {
                                                        "type": "string",
                                                        "description": "autostart or standing"
                                                    },
                                                    "gait": {
                                                        "type": "string",
                                                        "description": "trot or pace"
                                                    },
                                                    "meeting": {
                                                        "type": "string",
                                                        "description": "The meeting it is part of: its racecourse on its day"
                                                    },
                                                    "off_local": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time at the racecourse, with its UTC offset"
                                                    },
                                                    "timezone": {
                                                        "type": "string",
                                                        "description": "The racecourse's own time zone (a state's, in the US, Canada and Australia)"
                                                    },
                                                    "going": {
                                                        "type": "string",
                                                        "description": "The track's condition on the day where the source gives it: fast, wet fast, good, sloppy, muddy, slow, heavy"
                                                    },
                                                    "temperature_c": {
                                                        "type": "number",
                                                        "description": "Air temperature at the racecourse in degrees Celsius, where the source gives it"
                                                    },
                                                    "disputed": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Fields our sources disagree on with no known reason (winner, distance_m): the value shown is the best source's and is not yet settled. Empty when every source agrees"
                                                    },
                                                    "prize": {
                                                        "type": "object",
                                                        "description": "Total prize money and its currency"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "scheduled, running, final or abandoned"
                                                    },
                                                    "runners": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Every runner, in finishing order"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "yesterdays_results"
            }
        },
        "/v1/results/latest": {
            "get": {
                "operationId": "results_latest",
                "summary": "Latest results",
                "description": "Results that landed since a moment you give, newest first. Made for polling.",
                "tags": [
                    "Results"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "since",
                        "in": "query",
                        "required": false,
                        "description": "Only results newer than this, UTC",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our race id"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "The racecourse's own day"
                                                    },
                                                    "off": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time in UTC"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Race number on the day"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Race name"
                                                    },
                                                    "distance_m": {
                                                        "type": "integer",
                                                        "description": "Distance in metres"
                                                    },
                                                    "start": {
                                                        "type": "string",
                                                        "description": "autostart or standing"
                                                    },
                                                    "gait": {
                                                        "type": "string",
                                                        "description": "trot or pace"
                                                    },
                                                    "meeting": {
                                                        "type": "string",
                                                        "description": "The meeting it is part of: its racecourse on its day"
                                                    },
                                                    "off_local": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time at the racecourse, with its UTC offset"
                                                    },
                                                    "timezone": {
                                                        "type": "string",
                                                        "description": "The racecourse's own time zone (a state's, in the US, Canada and Australia)"
                                                    },
                                                    "going": {
                                                        "type": "string",
                                                        "description": "The track's condition on the day where the source gives it: fast, wet fast, good, sloppy, muddy, slow, heavy"
                                                    },
                                                    "temperature_c": {
                                                        "type": "number",
                                                        "description": "Air temperature at the racecourse in degrees Celsius, where the source gives it"
                                                    },
                                                    "disputed": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Fields our sources disagree on with no known reason (winner, distance_m): the value shown is the best source's and is not yet settled. Empty when every source agrees"
                                                    },
                                                    "prize": {
                                                        "type": "object",
                                                        "description": "Total prize money and its currency"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "scheduled, running, final or abandoned"
                                                    },
                                                    "landed": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "When we had the result, UTC"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/results/{race}": {
            "get": {
                "operationId": "result",
                "summary": "One result",
                "description": "One finished race with every runner, its times and prize money.",
                "tags": [
                    "Results"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "race",
                        "in": "path",
                        "required": true,
                        "description": "The race id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Our race id"
                                                },
                                                "country": {
                                                    "type": "string",
                                                    "description": "Country code"
                                                },
                                                "racecourse": {
                                                    "type": "object",
                                                    "description": "Racecourse id and name"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "The racecourse's own day"
                                                },
                                                "off": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "Start time in UTC"
                                                },
                                                "number": {
                                                    "type": "integer",
                                                    "description": "Race number on the day"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "description": "Race name"
                                                },
                                                "distance_m": {
                                                    "type": "integer",
                                                    "description": "Distance in metres"
                                                },
                                                "start": {
                                                    "type": "string",
                                                    "description": "autostart or standing"
                                                },
                                                "gait": {
                                                    "type": "string",
                                                    "description": "trot or pace"
                                                },
                                                "meeting": {
                                                    "type": "string",
                                                    "description": "The meeting it is part of: its racecourse on its day"
                                                },
                                                "off_local": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "Start time at the racecourse, with its UTC offset"
                                                },
                                                "timezone": {
                                                    "type": "string",
                                                    "description": "The racecourse's own time zone (a state's, in the US, Canada and Australia)"
                                                },
                                                "going": {
                                                    "type": "string",
                                                    "description": "The track's condition on the day where the source gives it: fast, wet fast, good, sloppy, muddy, slow, heavy"
                                                },
                                                "temperature_c": {
                                                    "type": "number",
                                                    "description": "Air temperature at the racecourse in degrees Celsius, where the source gives it"
                                                },
                                                "disputed": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Fields our sources disagree on with no known reason (winner, distance_m): the value shown is the best source's and is not yet settled. Empty when every source agrees"
                                                },
                                                "prize": {
                                                    "type": "object",
                                                    "description": "Total prize money and its currency"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "description": "scheduled, running, final or abandoned"
                                                },
                                                "runners": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Every runner"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/odds/{race}": {
            "get": {
                "operationId": "odds",
                "summary": "Odds now",
                "description": "The win price of every runner: the latest read before the off, the final price once run, and how far it has moved.",
                "tags": [
                    "Odds"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "race",
                        "in": "path",
                        "required": true,
                        "description": "The race id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Saddle cloth number"
                                                    },
                                                    "horse": {
                                                        "type": "object",
                                                        "description": "Horse id and name"
                                                    },
                                                    "win": {
                                                        "type": "number",
                                                        "description": "Win price, decimal: the final price once run, else the latest read"
                                                    },
                                                    "place": {
                                                        "type": "number",
                                                        "description": "Place price, decimal; null until the totes' place prices are carried"
                                                    },
                                                    "moved": {
                                                        "type": "number",
                                                        "description": "Change since the first price, %"
                                                    },
                                                    "at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "When this price was read, UTC"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "race_odds"
            }
        },
        "/v1/odds/{race}/history": {
            "get": {
                "operationId": "odds_history",
                "summary": "Odds history",
                "description": "Every win price we read for a race, runner by runner: every 5 minutes in its last hour, kept when it moves, then the final price. From 10 Nov 2026 for races priced by the Swedish, Nordic and French totes.",
                "tags": [
                    "Odds"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "race",
                        "in": "path",
                        "required": true,
                        "description": "The race id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Saddle cloth number"
                                                    },
                                                    "prices": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Each price read, oldest first"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/odds/movers": {
            "get": {
                "operationId": "odds_movers",
                "summary": "Market movers",
                "description": "Runners whose win price moved most in the last hour, across the races off in the next 3 hours, biggest first.",
                "tags": [
                    "Odds"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "race": {
                                                        "type": "object",
                                                        "description": "Race id, name and start time"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Saddle cloth number"
                                                    },
                                                    "horse": {
                                                        "type": "object",
                                                        "description": "Horse id and name"
                                                    },
                                                    "win": {
                                                        "type": "number",
                                                        "description": "Win price, decimal: the final price once run, else the latest read"
                                                    },
                                                    "place": {
                                                        "type": "number",
                                                        "description": "Place price, decimal; null until the totes' place prices are carried"
                                                    },
                                                    "moved": {
                                                        "type": "number",
                                                        "description": "Change since the first price, %"
                                                    },
                                                    "at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "When this price was read, UTC"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/archive/results": {
            "get": {
                "operationId": "archive_results",
                "summary": "Results by range",
                "description": "Every result between two days, by country or racecourse, as far back as we hold.",
                "tags": [
                    "Archive"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "First day, YYYY-MM-DD",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": true,
                        "description": "Last day, YYYY-MM-DD",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "racecourse",
                        "in": "query",
                        "required": false,
                        "description": "A racecourse id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our race id"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "The racecourse's own day"
                                                    },
                                                    "off": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time in UTC"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Race number on the day"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Race name"
                                                    },
                                                    "distance_m": {
                                                        "type": "integer",
                                                        "description": "Distance in metres"
                                                    },
                                                    "start": {
                                                        "type": "string",
                                                        "description": "autostart or standing"
                                                    },
                                                    "gait": {
                                                        "type": "string",
                                                        "description": "trot or pace"
                                                    },
                                                    "meeting": {
                                                        "type": "string",
                                                        "description": "The meeting it is part of: its racecourse on its day"
                                                    },
                                                    "off_local": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Start time at the racecourse, with its UTC offset"
                                                    },
                                                    "timezone": {
                                                        "type": "string",
                                                        "description": "The racecourse's own time zone (a state's, in the US, Canada and Australia)"
                                                    },
                                                    "going": {
                                                        "type": "string",
                                                        "description": "The track's condition on the day where the source gives it: fast, wet fast, good, sloppy, muddy, slow, heavy"
                                                    },
                                                    "temperature_c": {
                                                        "type": "number",
                                                        "description": "Air temperature at the racecourse in degrees Celsius, where the source gives it"
                                                    },
                                                    "disputed": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Fields our sources disagree on with no known reason (winner, distance_m): the value shown is the best source's and is not yet settled. Empty when every source agrees"
                                                    },
                                                    "prize": {
                                                        "type": "object",
                                                        "description": "Total prize money and its currency"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "scheduled, running, final or abandoned"
                                                    },
                                                    "runners": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Every runner"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "search_archive"
            }
        },
        "/v1/archive/days/{date}": {
            "get": {
                "operationId": "archive_day",
                "summary": "A whole day",
                "description": "One day from every country in one download, as JSON or CSV.",
                "tags": [
                    "Archive"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "date",
                        "in": "path",
                        "required": true,
                        "description": "The day, in the path",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "json or csv",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "json",
                                "csv"
                            ]
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "The day"
                                                },
                                                "races": {
                                                    "type": "integer",
                                                    "description": "Races in the file"
                                                },
                                                "runners": {
                                                    "type": "integer",
                                                    "description": "Runner rows in the file"
                                                },
                                                "download": {
                                                    "type": "string",
                                                    "description": "Address of the file, valid 1 hour"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/archive/meetings": {
            "get": {
                "operationId": "archive_meetings",
                "summary": "Meetings by range",
                "description": "Every meeting between two days, with its race count.",
                "tags": [
                    "Archive"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "First day, YYYY-MM-DD",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": true,
                        "description": "Last day, YYYY-MM-DD",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "racecourse",
                        "in": "query",
                        "required": false,
                        "description": "A racecourse id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our meeting id"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country code"
                                                    },
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "The racecourse's own day"
                                                    },
                                                    "races": {
                                                        "type": "integer",
                                                        "description": "Races on the card"
                                                    },
                                                    "first_off": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "First race, UTC"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "scheduled, racing, finished"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/search": {
            "get": {
                "operationId": "search",
                "summary": "Search",
                "description": "Find horses, drivers, trainers and racecourses by name.",
                "tags": [
                    "Archive"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "Words to find, at least 3 letters",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "horse, driver, trainer or racecourse",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "horse",
                                "driver",
                                "trainer",
                                "racecourse"
                            ]
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string",
                                                        "description": "What it is"
                                                    },
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Its id"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Its name"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "search"
            }
        },
        "/v1/horses": {
            "get": {
                "operationId": "horses",
                "summary": "List horses",
                "description": "Horses by country, sex or year of birth.",
                "tags": [
                    "Horses"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "born",
                        "in": "query",
                        "required": false,
                        "description": "Year of birth",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sex",
                        "in": "query",
                        "required": false,
                        "description": "mare, gelding or stallion",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "mare",
                                "gelding",
                                "stallion"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our horse id"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Name as raced"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Country it races from"
                                                    },
                                                    "born": {
                                                        "type": "integer",
                                                        "description": "Year of birth"
                                                    },
                                                    "sex": {
                                                        "type": "string",
                                                        "description": "mare, gelding or stallion"
                                                    },
                                                    "breed": {
                                                        "type": "string",
                                                        "description": "trotter, standardbred or cold-blooded"
                                                    },
                                                    "starts": {
                                                        "type": "integer",
                                                        "description": "Starts held"
                                                    },
                                                    "wins": {
                                                        "type": "integer",
                                                        "description": "Wins held"
                                                    },
                                                    "earnings": {
                                                        "type": "object",
                                                        "description": "Prize money held, by currency"
                                                    },
                                                    "best_km": {
                                                        "type": "string",
                                                        "description": "Best km time held"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/horses/{id}": {
            "get": {
                "operationId": "horse",
                "summary": "One horse",
                "description": "A horse's profile with its record and best km time.",
                "tags": [
                    "Horses"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The horse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Our horse id"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "description": "Name as raced"
                                                },
                                                "country": {
                                                    "type": "string",
                                                    "description": "Country it races from"
                                                },
                                                "born": {
                                                    "type": "integer",
                                                    "description": "Year of birth"
                                                },
                                                "sex": {
                                                    "type": "string",
                                                    "description": "mare, gelding or stallion"
                                                },
                                                "breed": {
                                                    "type": "string",
                                                    "description": "trotter, standardbred or cold-blooded"
                                                },
                                                "starts": {
                                                    "type": "integer",
                                                    "description": "Starts held"
                                                },
                                                "wins": {
                                                    "type": "integer",
                                                    "description": "Wins held"
                                                },
                                                "earnings": {
                                                    "type": "object",
                                                    "description": "Prize money held, by currency"
                                                },
                                                "best_km": {
                                                    "type": "string",
                                                    "description": "Best km time held"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "get_horse"
            }
        },
        "/v1/horses/{id}/starts": {
            "get": {
                "operationId": "horse_starts",
                "summary": "A horse's starts",
                "description": "Every start of a horse's career, newest first, with its place, driver and km time.",
                "tags": [
                    "Horses"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The horse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "race": {
                                                        "type": "object",
                                                        "description": "Race id, name and day"
                                                    },
                                                    "place": {
                                                        "type": "integer",
                                                        "description": "Finishing place, null when not placed"
                                                    },
                                                    "driver": {
                                                        "type": "object",
                                                        "description": "Driver id and name"
                                                    },
                                                    "trainer": {
                                                        "type": "object",
                                                        "description": "Trainer id and name"
                                                    },
                                                    "km_time": {
                                                        "type": "string",
                                                        "description": "Time per km, m:ss.t"
                                                    },
                                                    "odds": {
                                                        "type": "number",
                                                        "description": "Final odds, decimal"
                                                    },
                                                    "prize": {
                                                        "type": "number",
                                                        "description": "Prize money won"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "finished, disqualified, scratched or broke"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/horses/{id}/earnings": {
            "get": {
                "operationId": "horse_earnings",
                "summary": "A horse's earnings",
                "description": "Prize money year by year, with starts and wins.",
                "tags": [
                    "Horses"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The horse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "year": {
                                                        "type": "integer",
                                                        "description": "Year"
                                                    },
                                                    "starts": {
                                                        "type": "integer",
                                                        "description": "Starts"
                                                    },
                                                    "wins": {
                                                        "type": "integer",
                                                        "description": "Wins"
                                                    },
                                                    "earnings": {
                                                        "type": "object",
                                                        "description": "Prize money by currency"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/drivers": {
            "get": {
                "operationId": "drivers",
                "summary": "List drivers",
                "description": "Drivers by country, with their starts and wins.",
                "tags": [
                    "Drivers and trainers"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our id"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Name as published"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Main country"
                                                    },
                                                    "starts": {
                                                        "type": "integer",
                                                        "description": "Runners held"
                                                    },
                                                    "wins": {
                                                        "type": "integer",
                                                        "description": "Wins held"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per start, %"
                                                    },
                                                    "first": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "First runner held"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/drivers/{id}": {
            "get": {
                "operationId": "driver",
                "summary": "One driver",
                "description": "A driver's profile and record.",
                "tags": [
                    "Drivers and trainers"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The driver id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Our id"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "description": "Name as published"
                                                },
                                                "country": {
                                                    "type": "string",
                                                    "description": "Main country"
                                                },
                                                "starts": {
                                                    "type": "integer",
                                                    "description": "Runners held"
                                                },
                                                "wins": {
                                                    "type": "integer",
                                                    "description": "Wins held"
                                                },
                                                "win_rate": {
                                                    "type": "number",
                                                    "description": "Wins per start, %"
                                                },
                                                "first": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "First runner held"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "get_driver"
            }
        },
        "/v1/drivers/{id}/starts": {
            "get": {
                "operationId": "driver_starts",
                "summary": "A driver's drives",
                "description": "Every runner a driver drove, newest first.",
                "tags": [
                    "Drivers and trainers"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The driver id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "First day, YYYY-MM-DD",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": true,
                        "description": "Last day, YYYY-MM-DD",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "race": {
                                                        "type": "object",
                                                        "description": "Race id, name and day"
                                                    },
                                                    "place": {
                                                        "type": "integer",
                                                        "description": "Finishing place, null when not placed"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Saddle cloth number"
                                                    },
                                                    "post": {
                                                        "type": "integer",
                                                        "description": "Starting position"
                                                    },
                                                    "horse": {
                                                        "type": "object",
                                                        "description": "Horse id and name"
                                                    },
                                                    "km_time": {
                                                        "type": "string",
                                                        "description": "Time per km, m:ss.t"
                                                    },
                                                    "odds": {
                                                        "type": "number",
                                                        "description": "Final odds, decimal"
                                                    },
                                                    "prize": {
                                                        "type": "number",
                                                        "description": "Prize money won"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "finished, disqualified, scratched or broke"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/trainers": {
            "get": {
                "operationId": "trainers",
                "summary": "List trainers",
                "description": "Trainers by country, with their runners and wins.",
                "tags": [
                    "Drivers and trainers"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our id"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Name as published"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "description": "Main country"
                                                    },
                                                    "starts": {
                                                        "type": "integer",
                                                        "description": "Runners held"
                                                    },
                                                    "wins": {
                                                        "type": "integer",
                                                        "description": "Wins held"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per start, %"
                                                    },
                                                    "first": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "First runner held"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/trainers/{id}": {
            "get": {
                "operationId": "trainer",
                "summary": "One trainer",
                "description": "A trainer's profile and record.",
                "tags": [
                    "Drivers and trainers"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The trainer id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Our id"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "description": "Name as published"
                                                },
                                                "country": {
                                                    "type": "string",
                                                    "description": "Main country"
                                                },
                                                "starts": {
                                                    "type": "integer",
                                                    "description": "Runners held"
                                                },
                                                "wins": {
                                                    "type": "integer",
                                                    "description": "Wins held"
                                                },
                                                "win_rate": {
                                                    "type": "number",
                                                    "description": "Wins per start, %"
                                                },
                                                "first": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "description": "First runner held"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/trainers/{id}/starts": {
            "get": {
                "operationId": "trainer_starts",
                "summary": "A trainer's runners",
                "description": "Every runner a trainer sent out, newest first.",
                "tags": [
                    "Drivers and trainers"
                ],
                "x-plan": "archive",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The trainer id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "First day, YYYY-MM-DD",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": true,
                        "description": "Last day, YYYY-MM-DD",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "race": {
                                                        "type": "object",
                                                        "description": "Race id, name and day"
                                                    },
                                                    "place": {
                                                        "type": "integer",
                                                        "description": "Finishing place, null when not placed"
                                                    },
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Saddle cloth number"
                                                    },
                                                    "post": {
                                                        "type": "integer",
                                                        "description": "Starting position"
                                                    },
                                                    "horse": {
                                                        "type": "object",
                                                        "description": "Horse id and name"
                                                    },
                                                    "driver": {
                                                        "type": "object",
                                                        "description": "Driver id and name"
                                                    },
                                                    "km_time": {
                                                        "type": "string",
                                                        "description": "Time per km, m:ss.t"
                                                    },
                                                    "odds": {
                                                        "type": "number",
                                                        "description": "Final odds, decimal"
                                                    },
                                                    "prize": {
                                                        "type": "number",
                                                        "description": "Prize money won"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "finished, disqualified, scratched or broke"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/hooks": {
            "get": {
                "operationId": "hooks",
                "summary": "List webhooks",
                "description": "Your webhooks and their state.",
                "tags": [
                    "Webhooks"
                ],
                "x-plan": "live",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "Our webhook id"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "description": "Your https address"
                                                    },
                                                    "events": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Events it receives"
                                                    },
                                                    "countries": {
                                                        "type": "array",
                                                        "items": {},
                                                        "description": "Countries it covers, empty for all"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "active, or disabled after 50 missed deliveries running (a passing test turns it back on)"
                                                    },
                                                    "secret_hint": {
                                                        "type": "string",
                                                        "description": "Last four of the signing secret"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Added, UTC"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "hook_create",
                "summary": "Add a webhook",
                "description": "Send results to your https address, for every country or the ones you choose. Up to 10. Each delivery is signed: X-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"t.body\" with the secret>.",
                "tags": [
                    "Webhooks"
                ],
                "x-plan": "live",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Our webhook id"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "description": "Your https address"
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Events it receives"
                                                },
                                                "countries": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Countries it covers, empty for all"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "description": "active, or disabled after 50 missed deliveries running (a passing test turns it back on)"
                                                },
                                                "secret_hint": {
                                                    "type": "string",
                                                    "description": "Last four of the signing secret"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "description": "Added, UTC"
                                                },
                                                "secret": {
                                                    "type": "string",
                                                    "description": "The signing secret, shown once"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "Your https address"
                                    },
                                    "events": {
                                        "type": "string",
                                        "enum": [
                                            "result.final",
                                            "race.abandoned",
                                            "odds.final"
                                        ],
                                        "description": "Events to send, comma separated"
                                    },
                                    "country": {
                                        "type": "string",
                                        "enum": [
                                            "FR",
                                            "SE",
                                            "NO",
                                            "FI",
                                            "DK",
                                            "BE",
                                            "NL",
                                            "DE",
                                            "CH",
                                            "AT",
                                            "IT",
                                            "ES",
                                            "HU",
                                            "IE",
                                            "US",
                                            "CA",
                                            "AU",
                                            "NZ"
                                        ],
                                        "description": "One or more country codes, comma separated"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/hooks/{id}": {
            "delete": {
                "operationId": "hook_delete",
                "summary": "Remove a webhook",
                "description": "Stop sending to an address.",
                "tags": [
                    "Webhooks"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The webhook id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "The webhook removed"
                                                },
                                                "removed": {
                                                    "type": "boolean",
                                                    "description": "Always true"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/hooks/{id}/test": {
            "post": {
                "operationId": "hook_test",
                "summary": "Send a test",
                "description": "Send a real recent result to your address now, signed as usual.",
                "tags": [
                    "Webhooks"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The webhook id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "delivered": {
                                                    "type": "boolean",
                                                    "description": "Whether your address answered 2xx"
                                                },
                                                "http": {
                                                    "type": "integer",
                                                    "description": "What your address answered"
                                                },
                                                "ms": {
                                                    "type": "integer",
                                                    "description": "How long it took"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/hooks/{id}/deliveries": {
            "get": {
                "operationId": "hook_deliveries",
                "summary": "Deliveries",
                "description": "Each delivery to an address, with its answer and tries.",
                "tags": [
                    "Webhooks"
                ],
                "x-plan": "live",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The webhook id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor from the last answer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "event": {
                                                        "type": "string",
                                                        "description": "Event sent"
                                                    },
                                                    "race": {
                                                        "type": "string",
                                                        "description": "Race id"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "pending, ok, failed (after 7 tries) or cancelled"
                                                    },
                                                    "http": {
                                                        "type": "integer",
                                                        "description": "Your answer"
                                                    },
                                                    "tries": {
                                                        "type": "integer",
                                                        "description": "Tries so far"
                                                    },
                                                    "ms": {
                                                        "type": "integer",
                                                        "description": "How long the last try took"
                                                    },
                                                    "error": {
                                                        "type": "string",
                                                        "description": "What went wrong on the last try, when it did"
                                                    },
                                                    "at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Queued, UTC"
                                                    },
                                                    "last_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Last try, UTC"
                                                    },
                                                    "next_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "description": "Next try while pending, UTC"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/horses/{id}/form": {
            "get": {
                "operationId": "stats_horse_form",
                "summary": "Horse form",
                "description": "The form line, a rolling km time and a consistency score over the last starts.",
                "tags": [
                    "Statistics: horses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The horse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "starts",
                        "in": "query",
                        "required": false,
                        "description": "How many recent starts, at most 20",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "form": {
                                                    "type": "string",
                                                    "description": "Places, newest first; 0 when out of the places or not finishing"
                                                },
                                                "rolling_km": {
                                                    "type": "string",
                                                    "description": "Average km time over these starts"
                                                },
                                                "consistency": {
                                                    "type": "number",
                                                    "description": "Share of starts in the first three, %"
                                                },
                                                "trend": {
                                                    "type": "string",
                                                    "description": "improving, steady or declining"
                                                },
                                                "sample": {
                                                    "type": "integer",
                                                    "description": "Starts used"
                                                },
                                                "timed": {
                                                    "type": "integer",
                                                    "description": "Of those, starts with a km time"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "horse_form"
            }
        },
        "/v1/stats/horses/{id}/km-curve": {
            "get": {
                "operationId": "stats_horse_curve",
                "summary": "Km curve",
                "description": "Km time start by start over the career, with the fitted trend.",
                "tags": [
                    "Statistics: horses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The horse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "points": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Each start: day, distance and km time"
                                                },
                                                "trend_per_year": {
                                                    "type": "number",
                                                    "description": "Seconds per km gained a year, negative is faster"
                                                },
                                                "best": {
                                                    "type": "string",
                                                    "description": "Best km time"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/horses/{id}/distances": {
            "get": {
                "operationId": "stats_horse_distances",
                "summary": "Distance profile",
                "description": "Win and place rate and km time by distance band.",
                "tags": [
                    "Statistics: horses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The horse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "band": {
                                                        "type": "string",
                                                        "description": "Distance band"
                                                    },
                                                    "starts": {
                                                        "type": "integer",
                                                        "description": "Starts"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per start, %"
                                                    },
                                                    "place_rate": {
                                                        "type": "number",
                                                        "description": "First three per start, %"
                                                    },
                                                    "avg_km": {
                                                        "type": "string",
                                                        "description": "Average km time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/horses/{id}/racecourses": {
            "get": {
                "operationId": "stats_horse_courses",
                "summary": "Racecourse profile",
                "description": "The same profile, racecourse by racecourse.",
                "tags": [
                    "Statistics: horses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The horse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "starts": {
                                                        "type": "integer",
                                                        "description": "Starts"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per start, %"
                                                    },
                                                    "avg_km": {
                                                        "type": "string",
                                                        "description": "Average km time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/horses/{id}/rest": {
            "get": {
                "operationId": "stats_horse_rest",
                "summary": "Days between runs",
                "description": "How the horse runs by the days since its last start.",
                "tags": [
                    "Statistics: horses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The horse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "band": {
                                                        "type": "string",
                                                        "description": "Days since the last start"
                                                    },
                                                    "starts": {
                                                        "type": "integer",
                                                        "description": "Starts"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per start, %"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/drivers/{id}": {
            "get": {
                "operationId": "stats_driver",
                "summary": "Driver statistics",
                "description": "Strike rate, place rate and profit at final odds, for the season and the last 14 and 30 days.",
                "tags": [
                    "Statistics: people"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The driver id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "season",
                        "in": "query",
                        "required": false,
                        "description": "A year",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "period": {
                                                        "type": "string",
                                                        "description": "season, 30 days or 14 days"
                                                    },
                                                    "drives": {
                                                        "type": "integer",
                                                        "description": "Drives"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per drive, %"
                                                    },
                                                    "place_rate": {
                                                        "type": "number",
                                                        "description": "First three per drive, %"
                                                    },
                                                    "profit": {
                                                        "type": "number",
                                                        "description": "Profit for 1 unit on each drive with final odds, at those odds"
                                                    },
                                                    "with_odds": {
                                                        "type": "integer",
                                                        "description": "Drives with final odds, which profit rests on"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/drivers/{id}/racecourses": {
            "get": {
                "operationId": "stats_driver_courses",
                "summary": "Driver by racecourse",
                "description": "A driver's strike rate at each racecourse.",
                "tags": [
                    "Statistics: people"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The driver id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "season",
                        "in": "query",
                        "required": false,
                        "description": "A year",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "racecourse": {
                                                        "type": "object",
                                                        "description": "Racecourse id and name"
                                                    },
                                                    "drives": {
                                                        "type": "integer",
                                                        "description": "Drives"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per drive, %"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/trainers/{id}": {
            "get": {
                "operationId": "stats_trainer",
                "summary": "Trainer statistics",
                "description": "A trainer's strike rate, place rate and profit, for the season and the last 14 and 30 days.",
                "tags": [
                    "Statistics: people"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The trainer id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "season",
                        "in": "query",
                        "required": false,
                        "description": "A year",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "period": {
                                                        "type": "string",
                                                        "description": "season, 30 days or 14 days"
                                                    },
                                                    "runners": {
                                                        "type": "integer",
                                                        "description": "Runners"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per runner, %"
                                                    },
                                                    "profit": {
                                                        "type": "number",
                                                        "description": "Profit for 1 unit each at final odds"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/pairs": {
            "get": {
                "operationId": "stats_pairs",
                "summary": "Driver and trainer pairs",
                "description": "How a driver does for a trainer, or the best pairs in a country.",
                "tags": [
                    "Statistics: people"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "driver",
                        "in": "query",
                        "required": false,
                        "description": "A driver id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "trainer",
                        "in": "query",
                        "required": false,
                        "description": "A trainer id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "driver": {
                                                        "type": "object",
                                                        "description": "Driver"
                                                    },
                                                    "trainer": {
                                                        "type": "object",
                                                        "description": "Trainer"
                                                    },
                                                    "runners": {
                                                        "type": "integer",
                                                        "description": "Runners together"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per runner, %"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/head-to-head": {
            "get": {
                "operationId": "stats_h2h",
                "summary": "Head to head",
                "description": "Every race two horses met in, and who finished in front.",
                "tags": [
                    "Statistics: people"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "a",
                        "in": "query",
                        "required": true,
                        "description": "First horse id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "b",
                        "in": "query",
                        "required": true,
                        "description": "Second horse id",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "a": {
                                                    "type": "object",
                                                    "description": "The first horse, id and name"
                                                },
                                                "b": {
                                                    "type": "object",
                                                    "description": "The second horse, id and name"
                                                },
                                                "meetings": {
                                                    "type": "integer",
                                                    "description": "Races both ran in"
                                                },
                                                "a_ahead": {
                                                    "type": "integer",
                                                    "description": "Times the first finished in front"
                                                },
                                                "b_ahead": {
                                                    "type": "integer",
                                                    "description": "Times the second finished in front"
                                                },
                                                "races": {
                                                    "type": "array",
                                                    "items": {},
                                                    "description": "Each race with both places"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/draw-bias": {
            "get": {
                "operationId": "stats_draw",
                "summary": "Draw bias",
                "description": "Win share by starting position at a racecourse, for a distance and a start method.",
                "tags": [
                    "Statistics: racecourses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "racecourse",
                        "in": "query",
                        "required": true,
                        "description": "A racecourse id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "distance",
                        "in": "query",
                        "required": false,
                        "description": "Distance in metres, within 50 m",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start",
                        "in": "query",
                        "required": false,
                        "description": "autostart or standing",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "autostart",
                                "standing"
                            ]
                        }
                    },
                    {
                        "name": "years",
                        "in": "query",
                        "required": false,
                        "description": "How many seasons back, at most 10",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "post": {
                                                        "type": "integer",
                                                        "description": "Starting position"
                                                    },
                                                    "starts": {
                                                        "type": "integer",
                                                        "description": "Starts from it"
                                                    },
                                                    "win_share": {
                                                        "type": "number",
                                                        "description": "Wins per start, %"
                                                    },
                                                    "place_share": {
                                                        "type": "number",
                                                        "description": "First three per start, %"
                                                    },
                                                    "wins": {
                                                        "type": "integer",
                                                        "description": "Wins from it"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "draw_bias"
            }
        },
        "/v1/stats/start-method": {
            "get": {
                "operationId": "stats_start",
                "summary": "Start method",
                "description": "Autostart against standing start: win shares, breaks and km times at a racecourse.",
                "tags": [
                    "Statistics: racecourses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "racecourse",
                        "in": "query",
                        "required": true,
                        "description": "A racecourse id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "distance",
                        "in": "query",
                        "required": false,
                        "description": "Distance in metres, within 50 m",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "start": {
                                                        "type": "string",
                                                        "description": "autostart or standing"
                                                    },
                                                    "races": {
                                                        "type": "integer",
                                                        "description": "Races"
                                                    },
                                                    "break_rate": {
                                                        "type": "number",
                                                        "description": "Runners that broke stride, were disqualified or did not finish, %, over break_races; null under 50 runners"
                                                    },
                                                    "break_races": {
                                                        "type": "integer",
                                                        "description": "Races whose places cover every finisher, which the break rate rests on"
                                                    },
                                                    "runners": {
                                                        "type": "integer",
                                                        "description": "Runners it rests on"
                                                    },
                                                    "timed_races": {
                                                        "type": "integer",
                                                        "description": "Races with a winning km time"
                                                    },
                                                    "avg_km": {
                                                        "type": "string",
                                                        "description": "Average winning km time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/racecourses/{id}/par": {
            "get": {
                "operationId": "stats_par",
                "summary": "Par times",
                "description": "The par winning km time by distance and month at a racecourse.",
                "tags": [
                    "Statistics: racecourses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The racecourse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "distance_m": {
                                                        "type": "integer",
                                                        "description": "Distance"
                                                    },
                                                    "month": {
                                                        "type": "integer",
                                                        "description": "Month, 1 to 12"
                                                    },
                                                    "par_km": {
                                                        "type": "string",
                                                        "description": "Par winning km time"
                                                    },
                                                    "races": {
                                                        "type": "integer",
                                                        "description": "Races it rests on"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/racecourses/{id}/records": {
            "get": {
                "operationId": "stats_records",
                "summary": "Racecourse records",
                "description": "The fastest winning km time at each distance and start, with the horse that set it.",
                "tags": [
                    "Statistics: racecourses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The racecourse id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "distance_m": {
                                                        "type": "integer",
                                                        "description": "Distance"
                                                    },
                                                    "start": {
                                                        "type": "string",
                                                        "description": "autostart or standing"
                                                    },
                                                    "km_time": {
                                                        "type": "string",
                                                        "description": "Record km time"
                                                    },
                                                    "horse": {
                                                        "type": "object",
                                                        "description": "The horse"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "description": "When"
                                                    },
                                                    "race": {
                                                        "type": "string",
                                                        "description": "The race it was set in"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/breaks": {
            "get": {
                "operationId": "stats_breaks",
                "summary": "Breaks and disqualifications",
                "description": "How often runners break into a gallop or are disqualified, by horse, driver or racecourse.",
                "tags": [
                    "Statistics: racecourses"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "by",
                        "in": "query",
                        "required": true,
                        "description": "horse, driver or racecourse",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "horse",
                                "driver",
                                "racecourse"
                            ]
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": false,
                        "description": "One id, or leave out for a table",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "string",
                                                        "description": "Who or where"
                                                    },
                                                    "runners": {
                                                        "type": "integer",
                                                        "description": "Runners"
                                                    },
                                                    "break_rate": {
                                                        "type": "number",
                                                        "description": "Broke stride, disqualified or did not finish, %"
                                                    },
                                                    "dq_rate": {
                                                        "type": "number",
                                                        "description": "Disqualified, %: null, as our results do not tell a break from a disqualification"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/races/{id}/speed": {
            "get": {
                "operationId": "stats_speed",
                "summary": "Speed figures",
                "description": "A speed figure for every runner, set against the median winner at that racecourse, distance and start.",
                "tags": [
                    "Statistics: races"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The race id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Saddle cloth number"
                                                    },
                                                    "horse": {
                                                        "type": "object",
                                                        "description": "Horse"
                                                    },
                                                    "figure": {
                                                        "type": "integer",
                                                        "description": "Speed figure: 100 is the median winner at that racecourse, distance and start; 10 points a second a km"
                                                    },
                                                    "best_before": {
                                                        "type": "integer",
                                                        "description": "Its best figure before this race"
                                                    },
                                                    "place": {
                                                        "type": "integer",
                                                        "description": "Finishing place, once run"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "speed_figures"
            }
        },
        "/v1/stats/races/{id}/form-guide": {
            "get": {
                "operationId": "stats_form_guide",
                "summary": "Form guide",
                "description": "Every declared runner with its form line, last figure, driver strike rate and draw share, in one call.",
                "tags": [
                    "Statistics: races"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The race id, in the path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "number": {
                                                        "type": "integer",
                                                        "description": "Saddle cloth number"
                                                    },
                                                    "horse": {
                                                        "type": "object",
                                                        "description": "Horse"
                                                    },
                                                    "form": {
                                                        "type": "string",
                                                        "description": "Places, newest first"
                                                    },
                                                    "last_figure": {
                                                        "type": "integer",
                                                        "description": "Last speed figure"
                                                    },
                                                    "driver_win_rate": {
                                                        "type": "number",
                                                        "description": "Driver's wins per drive, 30 days, %"
                                                    },
                                                    "post_win_share": {
                                                        "type": "number",
                                                        "description": "Win share from this post here, %"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "x-mcp-tool": "form_guide"
            }
        },
        "/v1/stats/favourites": {
            "get": {
                "operationId": "stats_favourites",
                "summary": "Favourites",
                "description": "How often the favourite wins and what backing every favourite returned.",
                "tags": [
                    "Statistics: markets and trends"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "racecourse",
                        "in": "query",
                        "required": false,
                        "description": "A racecourse id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "season",
                        "in": "query",
                        "required": false,
                        "description": "A year",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "races": {
                                                    "type": "integer",
                                                    "description": "Races"
                                                },
                                                "fav_win_rate": {
                                                    "type": "number",
                                                    "description": "Favourites that won, %"
                                                },
                                                "profit": {
                                                    "type": "number",
                                                    "description": "Profit for 1 unit on each favourite"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/odds-bands": {
            "get": {
                "operationId": "stats_odds_bands",
                "summary": "Odds bands",
                "description": "Runners grouped by final odds: how often each band wins against what the odds said.",
                "tags": [
                    "Statistics: markets and trends"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "season",
                        "in": "query",
                        "required": false,
                        "description": "A year",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "band": {
                                                        "type": "string",
                                                        "description": "Final odds band"
                                                    },
                                                    "runners": {
                                                        "type": "integer",
                                                        "description": "Runners"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Won, %"
                                                    },
                                                    "implied": {
                                                        "type": "number",
                                                        "description": "Odds said, %"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/hot-form": {
            "get": {
                "operationId": "stats_hot",
                "summary": "Hot form",
                "description": "Drivers, trainers and horses winning most over the last 14 days.",
                "tags": [
                    "Statistics: markets and trends"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "driver, trainer or horse",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "driver",
                                "trainer",
                                "horse"
                            ]
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "object",
                                                        "description": "Who"
                                                    },
                                                    "runs": {
                                                        "type": "integer",
                                                        "description": "Runs in 14 days"
                                                    },
                                                    "wins": {
                                                        "type": "integer",
                                                        "description": "Wins"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Wins per run, %"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/leaders": {
            "get": {
                "operationId": "stats_leaders",
                "summary": "Leaderboards",
                "description": "Leaders by wins or prize money for a country and season.",
                "tags": [
                    "Statistics: markets and trends"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "required": true,
                        "description": "driver, trainer or horse",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "driver",
                                "trainer",
                                "horse"
                            ]
                        }
                    },
                    {
                        "name": "by",
                        "in": "query",
                        "required": false,
                        "description": "wins or prize",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "wins",
                                "prize"
                            ]
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "season",
                        "in": "query",
                        "required": false,
                        "description": "A year",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Items a page, at most 50",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "rank": {
                                                        "type": "integer",
                                                        "description": "Place on the board"
                                                    },
                                                    "name": {
                                                        "type": "object",
                                                        "description": "Who"
                                                    },
                                                    "wins": {
                                                        "type": "integer",
                                                        "description": "Wins"
                                                    },
                                                    "prize": {
                                                        "type": "object",
                                                        "description": "Prize money by currency"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/age-sex": {
            "get": {
                "operationId": "stats_age_sex",
                "summary": "Age and sex",
                "description": "Win rates and km times by age and sex.",
                "tags": [
                    "Statistics: markets and trends"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "season",
                        "in": "query",
                        "required": false,
                        "description": "A year",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "age": {
                                                        "type": "integer",
                                                        "description": "Age"
                                                    },
                                                    "sex": {
                                                        "type": "string",
                                                        "description": "mare, gelding or stallion"
                                                    },
                                                    "runners": {
                                                        "type": "integer",
                                                        "description": "Runners"
                                                    },
                                                    "win_rate": {
                                                        "type": "number",
                                                        "description": "Won, %"
                                                    },
                                                    "avg_km": {
                                                        "type": "string",
                                                        "description": "Average km time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/stats/trends": {
            "get": {
                "operationId": "stats_trends",
                "summary": "Trends",
                "description": "A measure year by year for a country: winning km time, field size, favourites or breaks.",
                "tags": [
                    "Statistics: markets and trends"
                ],
                "x-plan": "analyst",
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "One or more country codes, comma separated",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "FR",
                                "SE",
                                "NO",
                                "FI",
                                "DK",
                                "BE",
                                "NL",
                                "DE",
                                "CH",
                                "AT",
                                "IT",
                                "ES",
                                "HU",
                                "IE",
                                "US",
                                "CA",
                                "AU",
                                "NZ"
                            ]
                        }
                    },
                    {
                        "name": "measure",
                        "in": "query",
                        "required": true,
                        "description": "km_time, field_size, favourites or breaks",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "km_time",
                                "field_size",
                                "favourites",
                                "breaks"
                            ]
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "First year",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "year": {
                                                        "type": "integer",
                                                        "description": "Year"
                                                    },
                                                    "value": {
                                                        "type": "number",
                                                        "description": "The measure"
                                                    },
                                                    "races": {
                                                        "type": "integer",
                                                        "description": "Races it rests on"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}