{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "get_reference_data tool input",
  "description": "Input for the paid fetch of one governed reference-data code list. Mirrors GET /v1/reference-data/{domain}. Every optional member below is BUILD.md 8.7's, and the semantics are implemented in crates/core/src/operations/reference.rs: query and codes narrow the list, valid_at and include_inactive decide which values are current, limit and cursor page the result.",
  "type": "object",
  "required": [
    "domain"
  ],
  "additionalProperties": false,
  "properties": {
    "domain": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "description": "Reference-data domain identifier, as get_master_data_schema names it."
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Optional code or label search: a case-insensitive substring match against a value's code OR its label. Omit it to match every value."
    },
    "codes": {
      "type": "array",
      "maxItems": 100,
      "uniqueItems": true,
      "description": "Exact codes wanted. Set membership, never a substring match; omit it to narrow nothing.",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      }
    },
    "locale": {
      "type": "string",
      "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
      "default": "en",
      "description": "Language tag echoed on every served value and in the answer. Labels are served exactly as the snapshot stores them; there is no translation layer."
    },
    "valid_at": {
      "type": "string",
      "format": "date-time",
      "description": "The instant to evaluate each value's validity interval at. Defaults to the request clock. A value whose source DECLARES its interval is active when valid_from <= valid_at < valid_to, an absent or null bound open on its side. A value whose source states no interval at all is neither: it is served active: null and carries the reference_value_validity_unknown warning."
    },
    "include_inactive": {
      "type": "boolean",
      "default": false,
      "description": "Whether values not KNOWN to be active at valid_at are served. False excludes them; true serves them flagged - active: false for a value declared inactive, beside the reference_value_inactive warning, and active: null for one whose source states no validity interval, beside reference_value_validity_unknown - so an intentionally excluded value is distinguishable from an accidental match. Either warning is carried when such a value is WITHHELD too, so the omission is never silent."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 500,
      "default": 100,
      "description": "Page size, applied after query, codes, and validity have narrowed the list."
    },
    "cursor": {
      "type": "string",
      "maxLength": 2048,
      "description": "Opaque continuation cursor from a prior identical request. Bound to the operation, the normalized request, and the data_version it paged."
    }
  }
}
