{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aard-ai/json-schema/aard-ai-discover-request-schema.json",
  "title": "DiscoverRequest",
  "description": "Request body for POST /v1/discover: 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/DiscoverRequest",
  "type": "object",
  "properties": {
    "topic": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "What the data is about, in natural language. Naming one concrete code — a country, a city, an indicator — returns the anchored shape."
    },
    "agencies": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Restrict to these publisher codes (e.g. [\"ABS\", \"OECD\"]). Use only when the user names a publisher outright — it hides international sources reporting on a country. For a country use `region`. Forces the ranked shape."
    },
    "region": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Geography the question is about; affects coverage ranking, never the agency filter. Forces the ranked shape."
    },
    "user_country": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "The country the user is in. Pass only when they have stated where they are; never infer it from the question. Not the country the question is about — that is `region`. Prefers data covering the user's country when the question names no geography of its own. Forces the ranked shape."
    },
    "language": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "ISO search language. Anything but \"en\" forces the ranked shape — the anchor name index is English only.",
      "default": "en"
    },
    "keywords": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Override the auto-extracted graph-search terms. Rarely needed. Forces the ranked shape."
    },
    "offset": {
      "type": "integer",
      "description": "Row offset; pass `page.next_offset` from the previous response. Clamped to 0–10,000, not refused.",
      "default": 0
    },
    "limit": {
      "type": "integer",
      "description": "Rows to return, clamped to 1–100 (not refused). The anchored shape needs a family of at least max(15, limit), so a large limit makes the ranked shape more likely.",
      "default": 15
    },
    "source_country": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Deprecated since 2026-08-22: the former name of `user_country`, still accepted and treated identically. Send `user_country` instead; sending both in one request is a 400 invalid_request.",
      "deprecated": true
    }
  },
  "additionalProperties": false,
  "required": [
    "topic"
  ],
  "not": {
    "required": [
      "source_country",
      "user_country"
    ]
  }
}