{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aard-ai/json-schema/aard-ai-ask-request-schema.json",
  "title": "AskRequest",
  "description": "Request body for POST /v1/ask: one flat JSON object of tool arguments. Unknown names are rejected with 400 invalid_request, and the `detail` then lists every accepted name.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aard-ai-openapi.json#/components/schemas/AskRequest",
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Natural-language data question, e.g. \"What is infant mortality in Kenya?\""
    },
    "agencies": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Named publisher codes (e.g. [\"ESTAT\", \"OECD\"]); not the question's geography."
    },
    "language": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "ISO language code for search.",
      "default": "en"
    },
    "keywords": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Optional graph-search term overrides; normally inferred from the question."
    },
    "time_range": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Requested period, e.g. \"2020-2024\", \"since 2015\", \"last 5 years\"."
    },
    "geography": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Places the question is about, e.g. [\"Australia\"], [\"European Union\"]. Used to demote wrong-geography candidates in ranking; not a hard agency filter and not a URL filter."
    },
    "user_country": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "The country the user is in (e.g. \"New Zealand\"). Pass only when they have stated where they are; never infer it. Not the geography the question is about — that is `geography`."
    },
    "topic": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Optional subject or metric of the question (e.g. \"child labour\", \"GDP\") to sharpen ranking."
    },
    "currency": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Currency names or codes; not geographic phrases such as \"euro area\"."
    },
    "product": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Commodity or product names the question is about, e.g. \"wheat\", \"copper\"."
    },
    "scalar": {
      "type": "boolean",
      "description": "Prefer a series that yields a single observation.",
      "default": false
    },
    "top_n": {
      "type": "integer",
      "description": "Number of ranked candidates to prepare. Clamped to 1–100, not refused.",
      "default": 5
    },
    "cross_source": {
      "type": "boolean",
      "description": "Also find structurally analogous datasets at other agencies.",
      "default": false
    },
    "precision": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Request breadth: \"point\" (one observation), \"series\" (headline series defaults) or \"cube\" (the full cube).",
      "default": "series",
      "enum": [
        "point",
        "series",
        "cube"
      ]
    },
    "strict_time": {
      "type": "boolean",
      "description": "Drop candidates whose coverage is provably disjoint from `time_range`; unknown coverage is kept.",
      "default": false
    },
    "labels": {
      "type": "boolean",
      "description": "Request the publisher's labelled CSV where supported. Labelled rows run roughly 2-4x the plain bytes; pass false to halve the download.",
      "default": true
    }
  },
  "additionalProperties": false,
  "required": [
    "question"
  ]
}