Skip to main content
Glama

Validate Customs Code

validate_customs_code
Read-onlyIdempotent

Validate and describe one or more Combined Nomenclature codes.

For a single code, returns the full hierarchy of description levels (levels), the resolved customs_code_label, and has_subcodes. For a comma-separated list, returns {"results": [...]} with one entry per code (each either a success dict or a {"customs_code", "error"} pair).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "customs_code": "<customs_code>"
    },
    "name": "validate_customs_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoLanguage for translated labels in the response; any other language is refused.en
customs_codeYesOne customs code, or a comma-separated list of up to 50 codes (e.g. '73030010, 73030090'). The literal 'TOTAL' is also accepted.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / result / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "description": "GET /api/reference/validate-customs-code/{customs_code} — a validated\ncustoms code with its description hierarchy.  Also one batch item's\nsuccess shape.",
      -    "properties": {
      -      "customs_code": {
      -        "description": "The validated, normalised customs code.",
      -        "type": "string"
      -      },
      -      "customs_code_label": {
      -        "default": "",
      -        "description": "The code's display label (the deepest level's text).",
      -        "type": "string"
      -      },
      -      "has_subcodes": {
      -        "default": false,
      -        "description": "Whether the code has children in the current CN edition.",
      -        "type": "boolean"
      -      },
      -      "in_current_cn": {
      -        "anyOf": [
      -          {
      -            "type": "boolean"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "For digit codes: whether the current CN edition lists the code. False for a code known only from its recorded history (expired or abolished)."
      -      },
      -      "in_eurostat_api": {
      -        "anyOf": [
      -          {
      -            "type": "boolean"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "For residual spellings: whether Eurostat's API serves the code as a PRODUCT value (XX codes only)."
      -      },
      -      "interpreted_from": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "The raw input, when it was reformatted into customs_code (always the input as typed, never a note)."
      -      },
      -      "levels": {
      -        "description": "The code's CN description hierarchy (one entry per ancestor level), in the requested language.",
      -        "items": {
      -          "additionalProperties": false,
      -          "description": "One level of a customs code's description hierarchy, chapter first\n(``ComextNomenclature.get_description_levels``, plus the synthetic\nlevels of residual spellings and the dated levels of former editions).\n\nThe optional flags are sparse on the wire: present when true, absent\notherwise (the shape of the nomenclature layer's raw dicts).",
      -          "properties": {
      -            "customs_code": {
      -              "description": "The level's customs code.",
      -              "type": "string"
      -            },
      -            "is_catch_all": {
      -              "anyOf": [
      -                {
      -                  "type": "boolean"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ],
      -              "default": null,
      -              "description": "True for a catch-all ('other') level."
      -            },
      -            "residual": {
      -              "anyOf": [
      -                {
      -                  "type": "boolean"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ],
      -              "default": null,
      -              "description": "True for the synthetic level of a residual spelling."
      -            },
      -            "segment": {
      -              "anyOf": [
      -                {
      -                  "type": "boolean"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ],
      -              "default": null,
      -              "description": "True for a historical segment's own definition."
      -            },
      -            "siblings": {
      -              "anyOf": [
      -                {
      -                  "items": {
      -                    "additionalProperties": false,
      -                    "properties": {
      -                      "customs_code": {
      -                        "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
      -                        "type": "string"
      -                      },
      -                      "text": {
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "customs_code",
      -                      "text"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  "type": "array"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ],
      -              "default": null,
      -              "description": "For a catch-all level, the ordinary siblings it excludes."
      -            },
      -            "text": {
      -              "description": "The level's label, in the requested language.",
      -              "type": "string"
      -            },
      -            "untranslated": {
      -              "anyOf": [
      -                {
      -                  "type": "boolean"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ],
      -              "default": null,
      -              "description": "True when the label fell back to English."
      -            },
      -            "window": {
      -              "anyOf": [
      -                {
      -                  "additionalProperties": false,
      -                  "description": "The validity window of one customs-code segment (one definition).",
      -                  "properties": {
      -                    "valid_from": {
      -                      "description": "First day of the window, ISO date.",
      -                      "type": "string"
      -                    },
      -                    "valid_to": {
      -                      "anyOf": [
      -                        {
      -                          "type": "string"
      -                        },
      -                        {
      -                          "type": "null"
      -                        }
      -                      ],
      -                      "description": "Last day of the window, ISO date; null while in force."
      -                    }
      -                  },
      -                  "required": [
      -                    "valid_from",
      -                    "valid_to"
      -                  ],
      -                  "type": "object"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ],
      -              "default": null,
      -              "description": "For a level read from a dated edition (a former definition, or one of its ancestors as that edition had them): the validity window of the definition shown. Absent for current-edition levels."
      -            }
      -          },
      -          "required": [
      -            "customs_code",
      -            "text"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "residual_customs_codes": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "additionalProperties": false,
      -              "description": "One sub-code or residual customs code row, shared by breakdown views\n(``subcode-compare``, ``concentration-compare``, ``volatility``) and\nvalidation responses (``ValidateCustomsCodeResponse.residual_customs_codes``).",
      -              "properties": {
      -                "basket_key": {
      -                  "description": "The key of this row's basket in the payload's per-sub-code maps: the sub-code (read over the parent piece's window), or the entered basket's label.",
      -                  "type": "string"
      -                },
      -                "customs_code": {
      -                  "description": "The sub-code (or residual spelling).",
      -                  "type": "string"
      -                },
      -                "in_eurostat_api": {
      -                  "anyOf": [
      -                    {
      -                      "type": "boolean"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "For a residual row: whether Eurostat's API serves the spelling as a PRODUCT value (XX codes only)."
      -                },
      -                "label": {
      -                  "description": "The label of the row's (latest) definition, in the requested language when recorded.",
      -                  "type": "string"
      -                },
      -                "residual_kind": {
      -                  "anyOf": [
      -                    {
      -                      "enum": [
      -                        "xx",
      -                        "letter"
      -                      ],
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "For a residual row: 'xx' or 'letter'. Residual rows explain the gap between the sub-codes and the parent, and are pinned outside the top-N ranking."
      -                },
      -                "residual_reason": {
      -                  "anyOf": [
      -                    {
      -                      "enum": [
      -                        "A",
      -                        "B",
      -                        "C",
      -                        "E",
      -                        "F",
      -                        "I",
      -                        "M",
      -                        "P",
      -                        "R",
      -                        "S",
      -                        "T",
      -                        "V",
      -                        "W",
      -                        "Y"
      -                      ],
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
      -                },
      -                "residual_spelling": {
      -                  "anyOf": [
      -                    {
      -                      "enum": [
      -                        "xx",
      -                        "letter",
      -                        "reason_group"
      -                      ],
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
      -                },
      -                "segments": {
      -                  "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
      -                  "items": {
      -                    "additionalProperties": false,
      -                    "description": "One recorded definition of a customs code: a fact of the\nclassification metadata, with its window and its own label.",
      -                    "properties": {
      -                      "customs_code": {
      -                        "description": "The customs code the segment defines.",
      -                        "type": "string"
      -                      },
      -                      "kind": {
      -                        "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded').",
      -                        "enum": [
      -                          "cn",
      -                          "residual_xx",
      -                          "letter_coded",
      -                          "chapter_00",
      -                          "other"
      -                        ],
      -                        "type": "string"
      -                      },
      -                      "label": {
      -                        "description": "The segment's own label (the definition in force during its window), in the requested language when available.",
      -                        "type": "string"
      -                      },
      -                      "label_lang": {
      -                        "description": "The label's language (English when the requested one is not recorded for this definition).",
      -                        "enum": [
      -                          "bg",
      -                          "cs",
      -                          "da",
      -                          "de",
      -                          "el",
      -                          "en",
      -                          "es",
      -                          "et",
      -                          "fi",
      -                          "fr",
      -                          "ga",
      -                          "hr",
      -                          "hu",
      -                          "it",
      -                          "lt",
      -                          "lv",
      -                          "mt",
      -                          "nl",
      -                          "pl",
      -                          "pt",
      -                          "ro",
      -                          "sk",
      -                          "sl",
      -                          "sv"
      -                        ],
      -                        "type": "string"
      -                      },
      -                      "untranslated": {
      -                        "anyOf": [
      -                          {
      -                            "type": "boolean"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "default": null,
      -                        "description": "True when the label fell back to English."
      -                      },
      -                      "valid_from": {
      -                        "description": "First day of the segment's validity window, ISO date.",
      -                        "type": "string"
      -                      },
      -                      "valid_to": {
      -                        "anyOf": [
      -                          {
      -                            "type": "string"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "description": "Last day of the window, ISO date; null for a segment still in force."
      -                      }
      -                    },
      -                    "required": [
      -                      "customs_code",
      -                      "valid_from",
      -                      "valid_to",
      -                      "kind",
      -                      "label",
      -                      "label_lang"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  "type": "array"
      -                },
      -                "untranslated": {
      -                  "anyOf": [
      -                    {
      -                      "type": "boolean"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "True when the label fell back to English."
      -                }
      -              },
      -              "required": [
      -                "basket_key",
      -                "customs_code",
      -                "label",
      -                "segments"
      -              ],
      -              "type": "object"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Residual customs codes related to this code: those directly under a digit code (its XX code plus one reason group per reason letter), or the letter codes inside a reason group."
      -      },
      -      "residual_kind": {
      -        "anyOf": [
      -          {
      -            "enum": [
      -              "xx",
      -              "letter"
      -            ],
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Residual class for residual spellings: 'xx' or 'letter' (reason groups report 'letter', the class of the codes they group)."
      -      },
      -      "residual_reason": {
      -        "anyOf": [
      -          {
      -            "enum": [
      -              "A",
      -              "B",
      -              "C",
      -              "E",
      -              "F",
      -              "I",
      -              "M",
      -              "P",
      -              "R",
      -              "S",
      -              "T",
      -              "V",
      -              "W",
      -              "Y"
      -            ],
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "The reason letter of a letter code or reason group (S, Y, E, I, …)."
      -      },
      -      "residual_spelling": {
      -        "anyOf": [
      -          {
      -            "enum": [
      -              "xx",
      -              "letter",
      -              "reason_group"
      -            ],
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "The residual spelling's exact shape: 'xx', 'letter' or 'reason_group'."
      -      },
      -      "segment_history": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "additionalProperties": false,
      -              "description": "Every recorded definition of one customs code (the CN classification\nfiles), independent of the current edition.",
      -              "properties": {
      -                "customs_code": {
      -                  "description": "The base customs code.",
      -                  "type": "string"
      -                },
      -                "metadata_generation": {
      -                  "anyOf": [
      -                    {
      -                      "type": "integer"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "description": "The classification snapshot the history comes from."
      -                },
      -                "segments": {
      -                  "description": "The definitions, oldest first.",
      -                  "items": {
      -                    "additionalProperties": false,
      -                    "description": "One recorded definition of a customs code with its direct recorded\nlinks (``SegmentHistoryPayload.segments``).",
      -                    "properties": {
      -                      "customs_code": {
      -                        "description": "The customs code the segment defines.",
      -                        "type": "string"
      -                      },
      -                      "kind": {
      -                        "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded').",
      -                        "enum": [
      -                          "cn",
      -                          "residual_xx",
      -                          "letter_coded",
      -                          "chapter_00",
      -                          "other"
      -                        ],
      -                        "type": "string"
      -                      },
      -                      "label": {
      -                        "description": "The segment's own label (the definition in force during its window), in the requested language when available.",
      -                        "type": "string"
      -                      },
      -                      "label_lang": {
      -                        "description": "The label's language (English when the requested one is not recorded for this definition).",
      -                        "enum": [
      -                          "bg",
      -                          "cs",
      -                          "da",
      -                          "de",
      -                          "el",
      -                          "en",
      -                          "es",
      -                          "et",
      -                          "fi",
      -                          "fr",
      -                          "ga",
      -                          "hr",
      -                          "hu",
      -                          "it",
      -                          "lt",
      -                          "lv",
      -                          "mt",
      -                          "nl",
      -                          "pl",
      -                          "pt",
      -                          "ro",
      -                          "sk",
      -                          "sl",
      -                          "sv"
      -                        ],
      -                        "type": "string"
      -                      },
      -                      "recorded_links": {
      -                        "additionalProperties": false,
      -                        "description": "Direct correspondence edges recorded for this exact definition. An empty list means no recorded direct link -- not that the code never changed (headings have no edges of their own).",
      -                        "properties": {
      -                          "predecessors": {
      -                            "description": "Edges recorded into this segment.",
      -                            "items": {
      -                              "additionalProperties": false,
      -                              "description": "One recorded predecessor/successor edge of an exact segment.",
      -                              "properties": {
      -                                "customs_code": {
      -                                  "description": "The other segment's customs code.",
      -                                  "type": "string"
      -                                },
      -                                "marker": {
      -                                  "description": "Eurostat's relation marker, as recorded.",
      -                                  "type": "string"
      -                                },
      -                                "match": {
      -                                  "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment).",
      -                                  "enum": [
      -                                    "matched",
      -                                    "unmatched"
      -                                  ],
      -                                  "type": "string"
      -                                },
      -                                "valid_from": {
      -                                  "description": "The other segment's window start, ISO date.",
      -                                  "type": "string"
      -                                },
      -                                "valid_to": {
      -                                  "anyOf": [
      -                                    {
      -                                      "type": "string"
      -                                    },
      -                                    {
      -                                      "type": "null"
      -                                    }
      -                                  ],
      -                                  "description": "The other segment's window end, ISO date; null when open."
      -                                }
      -                              },
      -                              "required": [
      -                                "customs_code",
      -                                "valid_from",
      -                                "valid_to",
      -                                "marker",
      -                                "match"
      -                              ],
      -                              "type": "object"
      -                            },
      -                            "type": "array"
      -                          },
      -                          "successors": {
      -                            "description": "Edges recorded from this segment.",
      -                            "items": {
      -                              "additionalProperties": false,
      -                              "description": "One recorded predecessor/successor edge of an exact segment.",
      -                              "properties": {
      -                                "customs_code": {
      -                                  "description": "The other segment's customs code.",
      -                                  "type": "string"
      -                                },
      -                                "marker": {
      -                                  "description": "Eurostat's relation marker, as recorded.",
      -                                  "type": "string"
      -                                },
      -                                "match": {
      -                                  "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment).",
      -                                  "enum": [
      -                                    "matched",
      -                                    "unmatched"
      -                                  ],
      -                                  "type": "string"
      -                                },
      -                                "valid_from": {
      -                                  "description": "The other segment's window start, ISO date.",
      -                                  "type": "string"
      -                                },
      -                                "valid_to": {
      -                                  "anyOf": [
      -                                    {
      -                                      "type": "string"
      -                                    },
      -                                    {
      -                                      "type": "null"
      -                                    }
      -                                  ],
      -                                  "description": "The other segment's window end, ISO date; null when open."
      -                                }
      -                              },
      -                              "required": [
      -                                "customs_code",
      -                                "valid_from",
      -                                "valid_to",
      -                                "marker",
      -                                "match"
      -                              ],
      -                              "type": "object"
      -                            },
      -                            "type": "array"
      -                          }
      -                        },
      -                        "required": [
      -                          "successors",
      -                          "predecessors"
      -                        ],
      -                        "type": "object"
      -                      },
      -                      "untranslated": {
      -                        "anyOf": [
      -                          {
      -                            "type": "boolean"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "default": null,
      -                        "description": "True when the label fell back to English."
      -                      },
      -                      "valid_from": {
      -                        "description": "First day of the segment's validity window, ISO date.",
      -                        "type": "string"
      -                      },
      -                      "valid_to": {
      -                        "anyOf": [
      -                          {
      -                            "type": "string"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "description": "Last day of the window, ISO date; null for a segment still in force."
      -                      }
      -                    },
      -                    "required": [
      -                      "customs_code",
      -                      "valid_from",
      -                      "valid_to",
      -                      "kind",
      -                      "label",
      -                      "label_lang",
      -                      "recorded_links"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  "type": "array"
      -                }
      -              },
      -              "required": [
      -                "customs_code",
      -                "metadata_generation",
      -                "segments"
      -              ],
      -              "type": "object"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Every recorded definition of the code, with direct recorded links; null when no classification history is recorded for it. Use these windows to compose windowed pieces (the basket request form)."
      -      }
      -    },
      -    "required": [
      -      "customs_code"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "description": "The comma-separated batch path of validate-customs-code: each item a\nsuccess or an error.",
      -    "properties": {
      -      "results": {
      -        "description": "The results, one per input item, in input order.",
      -        "items": {
      -          "anyOf": [
      -            {
      -              "additionalProperties": false,
      -              "description": "GET /api/reference/validate-customs-code/{customs_code} — a validated\ncustoms code with its description hierarchy.  Also one batch item's\nsuccess shape.",
      -              "properties": {
      -                "customs_code": {
      -                  "description": "The validated, normalised customs code.",
      -                  "type": "string"
      -                },
      -                "customs_code_label": {
      -                  "default": "",
      -                  "description": "The code's display label (the deepest level's text).",
      -                  "type": "string"
      -                },
      -                "has_subcodes": {
      -                  "default": false,
      -                  "description": "Whether the code has children in the current CN edition.",
      -                  "type": "boolean"
      -                },
      -                "in_current_cn": {
      -                  "anyOf": [
      -                    {
      -                      "type": "boolean"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "For digit codes: whether the current CN edition lists the code. False for a code known only from its recorded history (expired or abolished)."
      -                },
      -                "in_eurostat_api": {
      -                  "anyOf": [
      -                    {
      -                      "type": "boolean"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "For residual spellings: whether Eurostat's API serves the code as a PRODUCT value (XX codes only)."
      -                },
      -                "interpreted_from": {
      -                  "anyOf": [
      -                    {
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "The raw input, when it was reformatted into customs_code (always the input as typed, never a note)."
      -                },
      -                "levels": {
      -                  "description": "The code's CN description hierarchy (one entry per ancestor level), in the requested language.",
      -                  "items": {
      -                    "additionalProperties": false,
      -                    "description": "One level of a customs code's description hierarchy, chapter first\n(``ComextNomenclature.get_description_levels``, plus the synthetic\nlevels of residual spellings and the dated levels of former editions).\n\nThe optional flags are sparse on the wire: present when true, absent\notherwise (the shape of the nomenclature layer's raw dicts).",
      -                    "properties": {
      -                      "customs_code": {
      -                        "description": "The level's customs code.",
      -                        "type": "string"
      -                      },
      -                      "is_catch_all": {
      -                        "anyOf": [
      -                          {
      -                            "type": "boolean"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "default": null,
      -                        "description": "True for a catch-all ('other') level."
      -                      },
      -                      "residual": {
      -                        "anyOf": [
      -                          {
      -                            "type": "boolean"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "default": null,
      -                        "description": "True for the synthetic level of a residual spelling."
      -                      },
      -                      "segment": {
      -                        "anyOf": [
      -                          {
      -                            "type": "boolean"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "default": null,
      -                        "description": "True for a historical segment's own definition."
      -                      },
      -                      "siblings": {
      -                        "anyOf": [
      -                          {
      -                            "items": {
      -                              "additionalProperties": false,
      -                              "properties": {
      -                                "customs_code": {
      -                                  "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
      -                                  "type": "string"
      -                                },
      -                                "text": {
      -                                  "type": "string"
      -                                }
      -                              },
      -                              "required": [
      -                                "customs_code",
      -                                "text"
      -                              ],
      -                              "type": "object"
      -                            },
      -                            "type": "array"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "default": null,
      -                        "description": "For a catch-all level, the ordinary siblings it excludes."
      -                      },
      -                      "text": {
      -                        "description": "The level's label, in the requested language.",
      -                        "type": "string"
      -                      },
      -                      "untranslated": {
      -                        "anyOf": [
      -                          {
      -                            "type": "boolean"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "default": null,
      -                        "description": "True when the label fell back to English."
      -                      },
      -                      "window": {
      -                        "anyOf": [
      -                          {
      -                            "additionalProperties": false,
      -                            "description": "The validity window of one customs-code segment (one definition).",
      -                            "properties": {
      -                              "valid_from": {
      -                                "description": "First day of the window, ISO date.",
      -                                "type": "string"
      -                              },
      -                              "valid_to": {
      -                                "anyOf": [
      -                                  {
      -                                    "type": "string"
      -                                  },
      -                                  {
      -                                    "type": "null"
      -                                  }
      -                                ],
      -                                "description": "Last day of the window, ISO date; null while in force."
      -                              }
      -                            },
      -                            "required": [
      -                              "valid_from",
      -                              "valid_to"
      -                            ],
      -                            "type": "object"
      -                          },
      -                          {
      -                            "type": "null"
      -                          }
      -                        ],
      -                        "default": null,
      -                        "description": "For a level read from a dated edition (a former definition, or one of its ancestors as that edition had them): the validity window of the definition shown. Absent for current-edition levels."
      -                      }
      -                    },
      -                    "required": [
      -                      "customs_code",
      -                      "text"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  "type": "array"
      -                },
      -                "residual_customs_codes": {
      -                  "anyOf": [
      -                    {
      -                      "items": {
      -                        "additionalProperties": false,
      -                        "description": "One sub-code or residual customs code row, shared by breakdown views\n(``subcode-compare``, ``concentration-compare``, ``volatility``) and\nvalidation responses (``ValidateCustomsCodeResponse.residual_customs_codes``).",
      -                        "properties": {
      -                          "basket_key": {
      -                            "description": "The key of this row's basket in the payload's per-sub-code maps: the sub-code (read over the parent piece's window), or the entered basket's label.",
      -                            "type": "string"
      -                          },
      -                          "customs_code": {
      -                            "description": "The sub-code (or residual spelling).",
      -                            "type": "string"
      -                          },
      -                          "in_eurostat_api": {
      -                            "anyOf": [
      -                              {
      -                                "type": "boolean"
      -                              },
      -                              {
      -                                "type": "null"
      -                              }
      -                            ],
      -                            "default": null,
      -                            "description": "For a residual row: whether Eurostat's API serves the spelling as a PRODUCT value (XX codes only)."
      -                          },
      -                          "label": {
      -                            "description": "The label of the row's (latest) definition, in the requested language when recorded.",
      -                            "type": "string"
      -                          },
      -                          "residual_kind": {
      -                            "anyOf": [
      -                              {
      -                                "enum": [
      -                                  "xx",
      -                                  "letter"
      -                                ],
      -                                "type": "string"
      -                              },
      -                              {
      -                                "type": "null"
      -                              }
      -                            ],
      -                            "default": null,
      -                            "description": "For a residual row: 'xx' or 'letter'. Residual rows explain the gap between the sub-codes and the parent, and are pinned outside the top-N ranking."
      -                          },
      -                          "residual_reason": {
      -                            "anyOf": [
      -                              {
      -                                "enum": [
      -                                  "A",
      -                                  "B",
      -                                  "C",
      -                                  "E",
      -                                  "F",
      -                                  "I",
      -                                  "M",
      -                                  "P",
      -                                  "R",
      -                                  "S",
      -                                  "T",
      -                                  "V",
      -                                  "W",
      -                                  "Y"
      -                                ],
      -                                "type": "string"
      -                              },
      -                              {
      -                                "type": "null"
      -                              }
      -                            ],
      -                            "default": null,
      -                            "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
      -                          },
      -                          "residual_spelling": {
      -                            "anyOf": [
      -                              {
      -                                "enum": [
      -                                  "xx",
      -                                  "letter",
      -                                  "reason_group"
      -                                ],
      -                                "type": "string"
      -                              },
      -                              {
      -                                "type": "null"
      -                              }
      -                            ],
      -                            "default": null,
      -                            "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
      -                          },
      -                          "segments": {
      -                            "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
      -                            "items": {
      -                              "additionalProperties": false,
      -                              "description": "One recorded definition of a customs code: a fact of the\nclassification metadata, with its window and its own label.",
      -                              "properties": {
      -                                "customs_code": {
      -                                  "description": "The customs code the segment defines.",
      -                                  "type": "string"
      -                                },
      -                                "kind": {
      -                                  "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded').",
      -                                  "enum": [
      -                                    "cn",
      -                                    "residual_xx",
      -                                    "letter_coded",
      -                                    "chapter_00",
      -                                    "other"
      -                                  ],
      -                                  "type": "string"
      -                                },
      -                                "label": {
      -                                  "description": "The segment's own label (the definition in force during its window), in the requested language when available.",
      -                                  "type": "string"
      -                                },
      -                                "label_lang": {
      -                                  "description": "The label's language (English when the requested one is not recorded for this definition).",
      -                                  "enum": [
      -                                    "bg",
      -                                    "cs",
      -                                    "da",
      -                                    "de",
      -                                    "el",
      -                                    "en",
      -                                    "es",
      -                                    "et",
      -                                    "fi",
      -                                    "fr",
      -                                    "ga",
      -                                    "hr",
      -                                    "hu",
      -                                    "it",
      -                                    "lt",
      -                                    "lv",
      -                                    "mt",
      -                                    "nl",
      -                                    "pl",
      -                                    "pt",
      -                                    "ro",
      -                                    "sk",
      -                                    "sl",
      -                                    "sv"
      -                                  ],
      -                                  "type": "string"
      -                                },
      -                                "untranslated": {
      -                                  "anyOf": [
      -                                    {
      -                                      "type": "boolean"
      -                                    },
      -                                    {
      -                                      "type": "null"
      -                                    }
      -                                  ],
      -                                  "default": null,
      -                                  "description": "True when the label fell back to English."
      -                                },
      -                                "valid_from": {
      -                                  "description": "First day of the segment's validity window, ISO date.",
      -                                  "type": "string"
      -                                },
      -                                "valid_to": {
      -                                  "anyOf": [
      -                                    {
      -                                      "type": "string"
      -                                    },
      -                                    {
      -                                      "type": "null"
      -                                    }
      -                                  ],
      -                                  "description": "Last day of the window, ISO date; null for a segment still in force."
      -                                }
      -                              },
      -                              "required": [
      -                                "customs_code",
      -                                "valid_from",
      -                                "valid_to",
      -                                "kind",
      -                                "label",
      -                                "label_lang"
      -                              ],
      -                              "type": "object"
      -                            },
      -                            "type": "array"
      -                          },
      -                          "untranslated": {
      -                            "anyOf": [
      -                              {
      -                                "type": "boolean"
      -                              },
      -                              {
      -                                "type": "null"
      -                              }
      -                            ],
      -                            "default": null,
      -                            "description": "True when the label fell back to English."
      -                          }
      -                        },
      -                        "required": [
      -                          "basket_key",
      -                          "customs_code",
      -                          "label",
      -                          "segments"
      -                        ],
      -                        "type": "object"
      -                      },
      -                      "type": "array"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "Residual customs codes related to this code: those directly under a digit code (its XX code plus one reason group per reason letter), or the letter codes inside a reason group."
      -                },
      -                "residual_kind": {
      -                  "anyOf": [
      -                    {
      -                      "enum": [
      -                        "xx",
      -                        "letter"
      -                      ],
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "Residual class for residual spellings: 'xx' or 'letter' (reason groups report 'letter', the class of the codes they group)."
      -                },
      -                "residual_reason": {
      -                  "anyOf": [
      -                    {
      -                      "enum": [
      -                        "A",
      -                        "B",
      -                        "C",
      -                        "E",
      -                        "F",
      -                        "I",
      -                        "M",
      -                        "P",
      -                        "R",
      -                        "S",
      -                        "T",
      -                        "V",
      -                        "W",
      -                        "Y"
      -                      ],
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "The reason letter of a letter code or reason group (S, Y, E, I, …)."
      -                },
      -                "residual_spelling": {
      -                  "anyOf": [
      -                    {
      -                      "enum": [
      -                        "xx",
      -                        "letter",
      -                        "reason_group"
      -                      ],
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "The residual spelling's exact shape: 'xx', 'letter' or 'reason_group'."
      -                },
      -                "segment_history": {
      -                  "anyOf": [
      -                    {
      -                      "items": {
      -                        "additionalProperties": false,
      -                        "description": "Every recorded definition of one customs code (the CN classification\nfiles), independent of the current edition.",
      -                        "properties": {
      -                          "customs_code": {
      -                            "description": "The base customs code.",
      -                            "type": "string"
      -                          },
      -                          "metadata_generation": {
      -                            "anyOf": [
      -                              {
      -                                "type": "integer"
      -                              },
      -                              {
      -                                "type": "null"
      -                              }
      -                            ],
      -                            "description": "The classification snapshot the history comes from."
      -                          },
      -                          "segments": {
      -                            "description": "The definitions, oldest first.",
      -                            "items": {
      -                              "additionalProperties": false,
      -                              "description": "One recorded definition of a customs code with its direct recorded\nlinks (``SegmentHistoryPayload.segments``).",
      -                              "properties": {
      -                                "customs_code": {
      -                                  "description": "The customs code the segment defines.",
      -                                  "type": "string"
      -                                },
      -                                "kind": {
      -                                  "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded').",
      -                                  "enum": [
      -                                    "cn",
      -                                    "residual_xx",
      -                                    "letter_coded",
      -                                    "chapter_00",
      -                                    "other"
      -                                  ],
      -                                  "type": "string"
      -                                },
      -                                "label": {
      -                                  "description": "The segment's own label (the definition in force during its window), in the requested language when available.",
      -                                  "type": "string"
      -                                },
      -                                "label_lang": {
      -                                  "description": "The label's language (English when the requested one is not recorded for this definition).",
      -                                  "enum": [
      -                                    "bg",
      -                                    "cs",
      -                                    "da",
      -                                    "de",
      -                                    "el",
      -                                    "en",
      -                                    "es",
      -                                    "et",
      -                                    "fi",
      -                                    "fr",
      -                                    "ga",
      -                                    "hr",
      -                                    "hu",
      -                                    "it",
      -                                    "lt",
      -                                    "lv",
      -                                    "mt",
      -                                    "nl",
      -                                    "pl",
      -                                    "pt",
      -                                    "ro",
      -                                    "sk",
      -                                    "sl",
      -                                    "sv"
      -                                  ],
      -                                  "type": "string"
      -                                },
      -                                "recorded_links": {
      -                                  "additionalProperties": false,
      -                                  "description": "Direct correspondence edges recorded for this exact definition. An empty list means no recorded direct link -- not that the code never changed (headings have no edges of their own).",
      -                                  "properties": {
      -                                    "predecessors": {
      -                                      "description": "Edges recorded into this segment.",
      -                                      "items": {
      -                                        "additionalProperties": false,
      -                                        "description": "One recorded predecessor/successor edge of an exact segment.",
      -                                        "properties": {
      -                                          "customs_code": {
      -                                            "description": "The other segment's customs code.",
      -                                            "type": "string"
      -                                          },
      -                                          "marker": {
      -                                            "description": "Eurostat's relation marker, as recorded.",
      -                                            "type": "string"
      -                                          },
      -                                          "match": {
      -                                            "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment).",
      -                                            "enum": [
      -                                              "matched",
      -                                              "unmatched"
      -                                            ],
      -                                            "type": "string"
      -                                          },
      -                                          "valid_from": {
      -                                            "description": "The other segment's window start, ISO date.",
      -                                            "type": "string"
      -                                          },
      -                                          "valid_to": {
      -                                            "anyOf": [
      -                                              {
      -                                                "type": "string"
      -                                              },
      -                                              {
      -                                                "type": "null"
      -                                              }
      -                                            ],
      -                                            "description": "The other segment's window end, ISO date; null when open."
      -                                          }
      -                                        },
      -                                        "required": [
      -                                          "customs_code",
      -                                          "valid_from",
      -                                          "valid_to",
      -                                          "marker",
      -                                          "match"
      -                                        ],
      -                                        "type": "object"
      -                                      },
      -                                      "type": "array"
      -                                    },
      -                                    "successors": {
      -                                      "description": "Edges recorded from this segment.",
      -                                      "items": {
      -                                        "additionalProperties": false,
      -                                        "description": "One recorded predecessor/successor edge of an exact segment.",
      -                                        "properties": {
      -                                          "customs_code": {
      -                                            "description": "The other segment's customs code.",
      -                                            "type": "string"
      -                                          },
      -                                          "marker": {
      -                                            "description": "Eurostat's relation marker, as recorded.",
      -                                            "type": "string"
      -                                          },
      -                                          "match": {
      -                                            "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment).",
      -                                            "enum": [
      -                                              "matched",
      -                                              "unmatched"
      -                                            ],
      -                                            "type": "string"
      -                                          },
      -                                          "valid_from": {
      -                                            "description": "The other segment's window start, ISO date.",
      -                                            "type": "string"
      -                                          },
      -                                          "valid_to": {
      -                                            "anyOf": [
      -                                              {
      -                                                "type": "string"
      -                                              },
      -                                              {
      -                                                "type": "null"
      -                                              }
      -                                            ],
      -                                            "description": "The other segment's window end, ISO date; null when open."
      -                                          }
      -                                        },
      -                                        "required": [
      -                                          "customs_code",
      -                                          "valid_from",
      -                                          "valid_to",
      -                                          "marker",
      -                                          "match"
      -                                        ],
      -                                        "type": "object"
      -                                      },
      -                                      "type": "array"
      -                                    }
      -                                  },
      -                                  "required": [
      -                                    "successors",
      -                                    "predecessors"
      -                                  ],
      -                                  "type": "object"
      -                                },
      -                                "untranslated": {
      -                                  "anyOf": [
      -                                    {
      -                                      "type": "boolean"
      -                                    },
      -                                    {
      -                                      "type": "null"
      -                                    }
      -                                  ],
      -                                  "default": null,
      -                                  "description": "True when the label fell back to English."
      -                                },
      -                                "valid_from": {
      -                                  "description": "First day of the segment's validity window, ISO date.",
      -                                  "type": "string"
      -                                },
      -                                "valid_to": {
      -                                  "anyOf": [
      -                                    {
      -                                      "type": "string"
      -                                    },
      -                                    {
      -                                      "type": "null"
      -                                    }
      -                                  ],
      -                                  "description": "Last day of the window, ISO date; null for a segment still in force."
      -                                }
      -                              },
      -                              "required": [
      -                                "customs_code",
      -                                "valid_from",
      -                                "valid_to",
      -                                "kind",
      -                                "label",
      -                                "label_lang",
      -                                "recorded_links"
      -                              ],
      -                              "type": "object"
      -                            },
      -                            "type": "array"
      -                          }
      -                        },
      -                        "required": [
      -                          "customs_code",
      -                          "metadata_generation",
      -                          "segments"
      -                        ],
      -                        "type": "object"
      -                      },
      -                      "type": "array"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ],
      -                  "default": null,
      -                  "description": "Every recorded definition of the code, with direct recorded links; null when no classification history is recorded for it. Use these windows to compose windowed pieces (the basket request form)."
      -                }
      -              },
      -              "required": [
      -                "customs_code"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "additionalProperties": false,
      -              "description": "One batch item's failure shape.",
      -              "properties": {
      -                "customs_code": {
      -                  "description": "The input item as typed.",
      -                  "type": "string"
      -                },
      -                "error": {
      -                  "additionalProperties": false,
      -                  "description": "Why it failed.",
      -                  "properties": {
      -                    "detail": {
      -                      "description": "The error message.",
      -                      "type": "string"
      -                    },
      -                    "status": {
      -                      "description": "The HTTP status the single-code endpoint would have returned.",
      -                      "type": "integer"
      -                    }
      -                  },
      -                  "required": [
      -                    "status",
      -                    "detail"
      -                  ],
      -                  "type": "object"
      -                }
      -              },
      -              "required": [
      -                "customs_code",
      -                "error"
      -              ],
      -              "type": "object"
      -            }
      -          ]
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "results"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "description": "GET /api/reference/validate-customs-code/{customs_code} — a validated\ncustoms code with its description hierarchy.  Also one batch item's\nsuccess shape.",
      +    "properties": {
      +      "customs_code": {
      +        "description": "The validated, normalised customs code.",
      +        "type": "string"
      +      },
      +      "customs_code_label": {
      +        "default": "",
      +        "description": "The code's display label (the deepest level's text).",
      +        "type": "string"
      +      },
      +      "has_subcodes": {
      +        "default": false,
      +        "description": "Whether the code has children in the current CN edition.",
      +        "type": "boolean"
      +      },
      +      "in_current_cn": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "For digit codes: whether the current CN edition lists the code. False for a code known only from its recorded history (expired or abolished)."
      +      },
      +      "in_eurostat_api": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "For residual spellings: whether Eurostat's API serves the code as a PRODUCT value (XX codes only)."
      +      },
      +      "interpreted_from": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The raw input, when it was reformatted into customs_code (always the input as typed, never a note)."
      +      },
      +      "levels": {
      +        "description": "The code's CN description hierarchy (one entry per ancestor level), in the requested language.",
      +        "items": {
      +          "additionalProperties": false,
      +          "description": "One level of a customs code's description hierarchy, chapter first\n(``ComextNomenclature.get_description_levels``, plus the synthetic\nlevels of residual spellings and the dated levels of former editions).\n\nThe optional flags are sparse on the wire: present when true, absent\notherwise (the shape of the nomenclature layer's raw dicts).",
      +          "properties": {
      +            "customs_code": {
      +              "description": "The level's customs code.",
      +              "type": "string"
      +            },
      +            "is_catch_all": {
      +              "anyOf": [
      +                {
      +                  "type": "boolean"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ],
      +              "default": null,
      +              "description": "True for a catch-all ('other') level."
      +            },
      +            "residual": {
      +              "anyOf": [
      +                {
      +                  "type": "boolean"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ],
      +              "default": null,
      +              "description": "True for the synthetic level of a residual spelling."
      +            },
      +            "segment": {
      +              "anyOf": [
      +                {
      +                  "type": "boolean"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ],
      +              "default": null,
      +              "description": "True for a historical segment's own definition."
      +            },
      +            "siblings": {
      +              "anyOf": [
      +                {
      +                  "items": {
      +                    "additionalProperties": false,
      +                    "properties": {
      +                      "customs_code": {
      +                        "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
      +                        "type": "string"
      +                      },
      +                      "text": {
      +                        "type": "string"
      +                      }
      +                    },
      +                    "required": [
      +                      "customs_code",
      +                      "text"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "type": "array"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ],
      +              "default": null,
      +              "description": "For a catch-all level, the ordinary siblings it excludes."
      +            },
      +            "text": {
      +              "description": "The level's label, in the requested language.",
      +              "type": "string"
      +            },
      +            "untranslated": {
      +              "anyOf": [
      +                {
      +                  "type": "boolean"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ],
      +              "default": null,
      +              "description": "True when the label fell back to English."
      +            },
      +            "window": {
      +              "anyOf": [
      +                {
      +                  "additionalProperties": false,
      +                  "description": "The validity window of one customs-code segment (one definition).",
      +                  "properties": {
      +                    "valid_from": {
      +                      "description": "First day of the window, ISO date.",
      +                      "type": "string"
      +                    },
      +                    "valid_to": {
      +                      "anyOf": [
      +                        {
      +                          "type": "string"
      +                        },
      +                        {
      +                          "type": "null"
      +                        }
      +                      ],
      +                      "description": "Last day of the window, ISO date; null while in force."
      +                    }
      +                  },
      +                  "required": [
      +                    "valid_from",
      +                    "valid_to"
      +                  ],
      +                  "type": "object"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ],
      +              "default": null,
      +              "description": "For a level read from a dated edition (a former definition, or one of its ancestors as that edition had them): the validity window of the definition shown. Absent for current-edition levels."
      +            }
      +          },
      +          "required": [
      +            "customs_code",
      +            "text"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "residual_customs_codes": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "additionalProperties": false,
      +              "description": "One sub-code or residual customs code row, shared by breakdown views\n(``subcode-compare``, ``concentration-compare``, ``volatility``) and\nvalidation responses (``ValidateCustomsCodeResponse.residual_customs_codes``).",
      +              "properties": {
      +                "basket_key": {
      +                  "description": "The key of this row's basket in the payload's per-sub-code maps: the sub-code (read over the parent piece's window), or the entered basket's label.",
      +                  "type": "string"
      +                },
      +                "customs_code": {
      +                  "description": "The sub-code (or residual spelling).",
      +                  "type": "string"
      +                },
      +                "in_eurostat_api": {
      +                  "anyOf": [
      +                    {
      +                      "type": "boolean"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "For a residual row: whether Eurostat's API serves the spelling as a PRODUCT value (XX codes only)."
      +                },
      +                "label": {
      +                  "description": "The label of the row's (latest) definition, in the requested language when recorded.",
      +                  "type": "string"
      +                },
      +                "residual_kind": {
      +                  "anyOf": [
      +                    {
      +                      "enum": [
      +                        "xx",
      +                        "letter"
      +                      ],
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "For a residual row: 'xx' or 'letter'. Residual rows explain the gap between the sub-codes and the parent, and are pinned outside the top-N ranking."
      +                },
      +                "residual_reason": {
      +                  "anyOf": [
      +                    {
      +                      "enum": [
      +                        "A",
      +                        "B",
      +                        "C",
      +                        "E",
      +                        "F",
      +                        "I",
      +                        "M",
      +                        "P",
      +                        "R",
      +                        "S",
      +                        "T",
      +                        "V",
      +                        "W",
      +                        "Y"
      +                      ],
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
      +                },
      +                "residual_spelling": {
      +                  "anyOf": [
      +                    {
      +                      "enum": [
      +                        "xx",
      +                        "letter",
      +                        "reason_group"
      +                      ],
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
      +                },
      +                "segments": {
      +                  "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
      +                  "items": {
      +                    "additionalProperties": false,
      +                    "description": "One recorded definition of a customs code: a fact of the\nclassification metadata, with its window and its own label.",
      +                    "properties": {
      +                      "customs_code": {
      +                        "description": "The customs code the segment defines.",
      +                        "type": "string"
      +                      },
      +                      "kind": {
      +                        "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded').",
      +                        "enum": [
      +                          "cn",
      +                          "residual_xx",
      +                          "letter_coded",
      +                          "chapter_00",
      +                          "other"
      +                        ],
      +                        "type": "string"
      +                      },
      +                      "label": {
      +                        "description": "The segment's own label (the definition in force during its window), in the requested language when available.",
      +                        "type": "string"
      +                      },
      +                      "label_lang": {
      +                        "description": "The label's language (English when the requested one is not recorded for this definition).",
      +                        "enum": [
      +                          "bg",
      +                          "cs",
      +                          "da",
      +                          "de",
      +                          "el",
      +                          "en",
      +                          "es",
      +                          "et",
      +                          "fi",
      +                          "fr",
      +                          "ga",
      +                          "hr",
      +                          "hu",
      +                          "it",
      +                          "lt",
      +                          "lv",
      +                          "mt",
      +                          "nl",
      +                          "pl",
      +                          "pt",
      +                          "ro",
      +                          "sk",
      +                          "sl",
      +                          "sv"
      +                        ],
      +                        "type": "string"
      +                      },
      +                      "untranslated": {
      +                        "anyOf": [
      +                          {
      +                            "type": "boolean"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "default": null,
      +                        "description": "True when the label fell back to English."
      +                      },
      +                      "valid_from": {
      +                        "description": "First day of the segment's validity window, ISO date.",
      +                        "type": "string"
      +                      },
      +                      "valid_to": {
      +                        "anyOf": [
      +                          {
      +                            "type": "string"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "description": "Last day of the window, ISO date; null for a segment still in force."
      +                      }
      +                    },
      +                    "required": [
      +                      "customs_code",
      +                      "valid_from",
      +                      "valid_to",
      +                      "kind",
      +                      "label",
      +                      "label_lang"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "type": "array"
      +                },
      +                "untranslated": {
      +                  "anyOf": [
      +                    {
      +                      "type": "boolean"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "True when the label fell back to English."
      +                }
      +              },
      +              "required": [
      +                "basket_key",
      +                "customs_code",
      +                "label",
      +                "segments"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Residual customs codes related to this code: those directly under a digit code (its XX code plus one reason group per reason letter), or the letter codes inside a reason group."
      +      },
      +      "residual_kind": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "xx",
      +              "letter"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Residual class for residual spellings: 'xx' or 'letter' (reason groups report 'letter', the class of the codes they group)."
      +      },
      +      "residual_reason": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "A",
      +              "B",
      +              "C",
      +              "E",
      +              "F",
      +              "I",
      +              "M",
      +              "P",
      +              "R",
      +              "S",
      +              "T",
      +              "V",
      +              "W",
      +              "Y"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The reason letter of a letter code or reason group (S, Y, E, I, …)."
      +      },
      +      "residual_spelling": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "xx",
      +              "letter",
      +              "reason_group"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The residual spelling's exact shape: 'xx', 'letter' or 'reason_group'."
      +      },
      +      "segment_history": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "additionalProperties": false,
      +              "description": "Every recorded definition of one customs code (the CN classification\nfiles), independent of the current edition.",
      +              "properties": {
      +                "customs_code": {
      +                  "description": "The base customs code.",
      +                  "type": "string"
      +                },
      +                "metadata_generation": {
      +                  "anyOf": [
      +                    {
      +                      "type": "integer"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "description": "The classification snapshot the history comes from."
      +                },
      +                "segments": {
      +                  "description": "The definitions, oldest first.",
      +                  "items": {
      +                    "additionalProperties": false,
      +                    "description": "One recorded definition of a customs code with its direct recorded\nlinks (``SegmentHistoryPayload.segments``).",
      +                    "properties": {
      +                      "customs_code": {
      +                        "description": "The customs code the segment defines.",
      +                        "type": "string"
      +                      },
      +                      "kind": {
      +                        "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded').",
      +                        "enum": [
      +                          "cn",
      +                          "residual_xx",
      +                          "letter_coded",
      +                          "chapter_00",
      +                          "other"
      +                        ],
      +                        "type": "string"
      +                      },
      +                      "label": {
      +                        "description": "The segment's own label (the definition in force during its window), in the requested language when available.",
      +                        "type": "string"
      +                      },
      +                      "label_lang": {
      +                        "description": "The label's language (English when the requested one is not recorded for this definition).",
      +                        "enum": [
      +                          "bg",
      +                          "cs",
      +                          "da",
      +                          "de",
      +                          "el",
      +                          "en",
      +                          "es",
      +                          "et",
      +                          "fi",
      +                          "fr",
      +                          "ga",
      +                          "hr",
      +                          "hu",
      +                          "it",
      +                          "lt",
      +                          "lv",
      +                          "mt",
      +                          "nl",
      +                          "pl",
      +                          "pt",
      +                          "ro",
      +                          "sk",
      +                          "sl",
      +                          "sv"
      +                        ],
      +                        "type": "string"
      +                      },
      +                      "recorded_links": {
      +                        "additionalProperties": false,
      +                        "description": "Direct correspondence edges recorded for this exact definition. An empty list means no recorded direct link -- not that the code never changed (headings have no edges of their own).",
      +                        "properties": {
      +                          "predecessors": {
      +                            "description": "Edges recorded into this segment.",
      +                            "items": {
      +                              "additionalProperties": false,
      +                              "description": "One recorded predecessor/successor edge of an exact segment.",
      +                              "properties": {
      +                                "customs_code": {
      +                                  "description": "The other segment's customs code.",
      +                                  "type": "string"
      +                                },
      +                                "marker": {
      +                                  "description": "Eurostat's relation marker, as recorded.",
      +                                  "type": "string"
      +                                },
      +                                "match": {
      +                                  "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment).",
      +                                  "enum": [
      +                                    "matched",
      +                                    "unmatched"
      +                                  ],
      +                                  "type": "string"
      +                                },
      +                                "valid_from": {
      +                                  "description": "The other segment's window start, ISO date.",
      +                                  "type": "string"
      +                                },
      +                                "valid_to": {
      +                                  "anyOf": [
      +                                    {
      +                                      "type": "string"
      +                                    },
      +                                    {
      +                                      "type": "null"
      +                                    }
      +                                  ],
      +                                  "description": "The other segment's window end, ISO date; null when open."
      +                                }
      +                              },
      +                              "required": [
      +                                "customs_code",
      +                                "valid_from",
      +                                "valid_to",
      +                                "marker",
      +                                "match"
      +                              ],
      +                              "type": "object"
      +                            },
      +                            "type": "array"
      +                          },
      +                          "successors": {
      +                            "description": "Edges recorded from this segment.",
      +                            "items": {
      +                              "additionalProperties": false,
      +                              "description": "One recorded predecessor/successor edge of an exact segment.",
      +                              "properties": {
      +                                "customs_code": {
      +                                  "description": "The other segment's customs code.",
      +                                  "type": "string"
      +                                },
      +                                "marker": {
      +                                  "description": "Eurostat's relation marker, as recorded.",
      +                                  "type": "string"
      +                                },
      +                                "match": {
      +                                  "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment).",
      +                                  "enum": [
      +                                    "matched",
      +                                    "unmatched"
      +                                  ],
      +                                  "type": "string"
      +                                },
      +                                "valid_from": {
      +                                  "description": "The other segment's window start, ISO date.",
      +                                  "type": "string"
      +                                },
      +                                "valid_to": {
      +                                  "anyOf": [
      +                                    {
      +                                      "type": "string"
      +                                    },
      +                                    {
      +                                      "type": "null"
      +                                    }
      +                                  ],
      +                                  "description": "The other segment's window end, ISO date; null when open."
      +                                }
      +                              },
      +                              "required": [
      +                                "customs_code",
      +                                "valid_from",
      +                                "valid_to",
      +                                "marker",
      +                                "match"
      +                              ],
      +                              "type": "object"
      +                            },
      +                            "type": "array"
      +                          }
      +                        },
      +                        "required": [
      +                          "successors",
      +                          "predecessors"
      +                        ],
      +                        "type": "object"
      +                      },
      +                      "untranslated": {
      +                        "anyOf": [
      +                          {
      +                            "type": "boolean"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "default": null,
      +                        "description": "True when the label fell back to English."
      +                      },
      +                      "valid_from": {
      +                        "description": "First day of the segment's validity window, ISO date.",
      +                        "type": "string"
      +                      },
      +                      "valid_to": {
      +                        "anyOf": [
      +                          {
      +                            "type": "string"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "description": "Last day of the window, ISO date; null for a segment still in force."
      +                      }
      +                    },
      +                    "required": [
      +                      "customs_code",
      +                      "valid_from",
      +                      "valid_to",
      +                      "kind",
      +                      "label",
      +                      "label_lang",
      +                      "recorded_links"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "type": "array"
      +                }
      +              },
      +              "required": [
      +                "customs_code",
      +                "metadata_generation",
      +                "segments"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Every recorded definition of the code, with direct recorded links; null when no classification history is recorded for it. Use these windows to compose windowed pieces (the basket request form)."
      +      }
      +    },
      +    "required": [
      +      "customs_code",
      +      "levels",
      +      "customs_code_label",
      +      "has_subcodes",
      +      "interpreted_from",
      +      "residual_kind",
      +      "residual_spelling",
      +      "residual_reason",
      +      "in_eurostat_api",
      +      "residual_customs_codes",
      +      "in_current_cn",
      +      "segment_history"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "The comma-separated batch path of validate-customs-code: each item a\nsuccess or an error.",
      +    "properties": {
      +      "results": {
      +        "description": "The results, one per input item, in input order.",
      +        "items": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": false,
      +              "description": "GET /api/reference/validate-customs-code/{customs_code} — a validated\ncustoms code with its description hierarchy.  Also one batch item's\nsuccess shape.",
      +              "properties": {
      +                "customs_code": {
      +                  "description": "The validated, normalised customs code.",
      +                  "type": "string"
      +                },
      +                "customs_code_label": {
      +                  "default": "",
      +                  "description": "The code's display label (the deepest level's text).",
      +                  "type": "string"
      +                },
      +                "has_subcodes": {
      +                  "default": false,
      +                  "description": "Whether the code has children in the current CN edition.",
      +                  "type": "boolean"
      +                },
      +                "in_current_cn": {
      +                  "anyOf": [
      +                    {
      +                      "type": "boolean"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "For digit codes: whether the current CN edition lists the code. False for a code known only from its recorded history (expired or abolished)."
      +                },
      +                "in_eurostat_api": {
      +                  "anyOf": [
      +                    {
      +                      "type": "boolean"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "For residual spellings: whether Eurostat's API serves the code as a PRODUCT value (XX codes only)."
      +                },
      +                "interpreted_from": {
      +                  "anyOf": [
      +                    {
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "The raw input, when it was reformatted into customs_code (always the input as typed, never a note)."
      +                },
      +                "levels": {
      +                  "description": "The code's CN description hierarchy (one entry per ancestor level), in the requested language.",
      +                  "items": {
      +                    "additionalProperties": false,
      +                    "description": "One level of a customs code's description hierarchy, chapter first\n(``ComextNomenclature.get_description_levels``, plus the synthetic\nlevels of residual spellings and the dated levels of former editions).\n\nThe optional flags are sparse on the wire: present when true, absent\notherwise (the shape of the nomenclature layer's raw dicts).",
      +                    "properties": {
      +                      "customs_code": {
      +                        "description": "The level's customs code.",
      +                        "type": "string"
      +                      },
      +                      "is_catch_all": {
      +                        "anyOf": [
      +                          {
      +                            "type": "boolean"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "default": null,
      +                        "description": "True for a catch-all ('other') level."
      +                      },
      +                      "residual": {
      +                        "anyOf": [
      +                          {
      +                            "type": "boolean"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "default": null,
      +                        "description": "True for the synthetic level of a residual spelling."
      +                      },
      +                      "segment": {
      +                        "anyOf": [
      +                          {
      +                            "type": "boolean"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "default": null,
      +                        "description": "True for a historical segment's own definition."
      +                      },
      +                      "siblings": {
      +                        "anyOf": [
      +                          {
      +                            "items": {
      +                              "additionalProperties": false,
      +                              "properties": {
      +                                "customs_code": {
      +                                  "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
      +                                  "type": "string"
      +                                },
      +                                "text": {
      +                                  "type": "string"
      +                                }
      +                              },
      +                              "required": [
      +                                "customs_code",
      +                                "text"
      +                              ],
      +                              "type": "object"
      +                            },
      +                            "type": "array"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "default": null,
      +                        "description": "For a catch-all level, the ordinary siblings it excludes."
      +                      },
      +                      "text": {
      +                        "description": "The level's label, in the requested language.",
      +                        "type": "string"
      +                      },
      +                      "untranslated": {
      +                        "anyOf": [
      +                          {
      +                            "type": "boolean"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "default": null,
      +                        "description": "True when the label fell back to English."
      +                      },
      +                      "window": {
      +                        "anyOf": [
      +                          {
      +                            "additionalProperties": false,
      +                            "description": "The validity window of one customs-code segment (one definition).",
      +                            "properties": {
      +                              "valid_from": {
      +                                "description": "First day of the window, ISO date.",
      +                                "type": "string"
      +                              },
      +                              "valid_to": {
      +                                "anyOf": [
      +                                  {
      +                                    "type": "string"
      +                                  },
      +                                  {
      +                                    "type": "null"
      +                                  }
      +                                ],
      +                                "description": "Last day of the window, ISO date; null while in force."
      +                              }
      +                            },
      +                            "required": [
      +                              "valid_from",
      +                              "valid_to"
      +                            ],
      +                            "type": "object"
      +                          },
      +                          {
      +                            "type": "null"
      +                          }
      +                        ],
      +                        "default": null,
      +                        "description": "For a level read from a dated edition (a former definition, or one of its ancestors as that edition had them): the validity window of the definition shown. Absent for current-edition levels."
      +                      }
      +                    },
      +                    "required": [
      +                      "customs_code",
      +                      "text"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "type": "array"
      +                },
      +                "residual_customs_codes": {
      +                  "anyOf": [
      +                    {
      +                      "items": {
      +                        "additionalProperties": false,
      +                        "description": "One sub-code or residual customs code row, shared by breakdown views\n(``subcode-compare``, ``concentration-compare``, ``volatility``) and\nvalidation responses (``ValidateCustomsCodeResponse.residual_customs_codes``).",
      +                        "properties": {
      +                          "basket_key": {
      +                            "description": "The key of this row's basket in the payload's per-sub-code maps: the sub-code (read over the parent piece's window), or the entered basket's label.",
      +                            "type": "string"
      +                          },
      +                          "customs_code": {
      +                            "description": "The sub-code (or residual spelling).",
      +                            "type": "string"
      +                          },
      +                          "in_eurostat_api": {
      +                            "anyOf": [
      +                              {
      +                                "type": "boolean"
      +                              },
      +                              {
      +                                "type": "null"
      +                              }
      +                            ],
      +                            "default": null,
      +                            "description": "For a residual row: whether Eurostat's API serves the spelling as a PRODUCT value (XX codes only)."
      +                          },
      +                          "label": {
      +                            "description": "The label of the row's (latest) definition, in the requested language when recorded.",
      +                            "type": "string"
      +                          },
      +                          "residual_kind": {
      +                            "anyOf": [
      +                              {
      +                                "enum": [
      +                                  "xx",
      +                                  "letter"
      +                                ],
      +                                "type": "string"
      +                              },
      +                              {
      +                                "type": "null"
      +                              }
      +                            ],
      +                            "default": null,
      +                            "description": "For a residual row: 'xx' or 'letter'. Residual rows explain the gap between the sub-codes and the parent, and are pinned outside the top-N ranking."
      +                          },
      +                          "residual_reason": {
      +                            "anyOf": [
      +                              {
      +                                "enum": [
      +                                  "A",
      +                                  "B",
      +                                  "C",
      +                                  "E",
      +                                  "F",
      +                                  "I",
      +                                  "M",
      +                                  "P",
      +                                  "R",
      +                                  "S",
      +                                  "T",
      +                                  "V",
      +                                  "W",
      +                                  "Y"
      +                                ],
      +                                "type": "string"
      +                              },
      +                              {
      +                                "type": "null"
      +                              }
      +                            ],
      +                            "default": null,
      +                            "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
      +                          },
      +                          "residual_spelling": {
      +                            "anyOf": [
      +                              {
      +                                "enum": [
      +                                  "xx",
      +                                  "letter",
      +                                  "reason_group"
      +                                ],
      +                                "type": "string"
      +                              },
      +                              {
      +                                "type": "null"
      +                              }
      +                            ],
      +                            "default": null,
      +                            "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
      +                          },
      +                          "segments": {
      +                            "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
      +                            "items": {
      +                              "additionalProperties": false,
      +                              "description": "One recorded definition of a customs code: a fact of the\nclassification metadata, with its window and its own label.",
      +                              "properties": {
      +                                "customs_code": {
      +                                  "description": "The customs code the segment defines.",
      +                                  "type": "string"
      +                                },
      +                                "kind": {
      +                                  "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded').",
      +                                  "enum": [
      +                                    "cn",
      +                                    "residual_xx",
      +                                    "letter_coded",
      +                                    "chapter_00",
      +                                    "other"
      +                                  ],
      +                                  "type": "string"
      +                                },
      +                                "label": {
      +                                  "description": "The segment's own label (the definition in force during its window), in the requested language when available.",
      +                                  "type": "string"
      +                                },
      +                                "label_lang": {
      +                                  "description": "The label's language (English when the requested one is not recorded for this definition).",
      +                                  "enum": [
      +                                    "bg",
      +                                    "cs",
      +                                    "da",
      +                                    "de",
      +                                    "el",
      +                                    "en",
      +                                    "es",
      +                                    "et",
      +                                    "fi",
      +                                    "fr",
      +                                    "ga",
      +                                    "hr",
      +                                    "hu",
      +                                    "it",
      +                                    "lt",
      +                                    "lv",
      +                                    "mt",
      +                                    "nl",
      +                                    "pl",
      +                                    "pt",
      +                                    "ro",
      +                                    "sk",
      +                                    "sl",
      +                                    "sv"
      +                                  ],
      +                                  "type": "string"
      +                                },
      +                                "untranslated": {
      +                                  "anyOf": [
      +                                    {
      +                                      "type": "boolean"
      +                                    },
      +                                    {
      +                                      "type": "null"
      +                                    }
      +                                  ],
      +                                  "default": null,
      +                                  "description": "True when the label fell back to English."
      +                                },
      +                                "valid_from": {
      +                                  "description": "First day of the segment's validity window, ISO date.",
      +                                  "type": "string"
      +                                },
      +                                "valid_to": {
      +                                  "anyOf": [
      +                                    {
      +                                      "type": "string"
      +                                    },
      +                                    {
      +                                      "type": "null"
      +                                    }
      +                                  ],
      +                                  "description": "Last day of the window, ISO date; null for a segment still in force."
      +                                }
      +                              },
      +                              "required": [
      +                                "customs_code",
      +                                "valid_from",
      +                                "valid_to",
      +                                "kind",
      +                                "label",
      +                                "label_lang"
      +                              ],
      +                              "type": "object"
      +                            },
      +                            "type": "array"
      +                          },
      +                          "untranslated": {
      +                            "anyOf": [
      +                              {
      +                                "type": "boolean"
      +                              },
      +                              {
      +                                "type": "null"
      +                              }
      +                            ],
      +                            "default": null,
      +                            "description": "True when the label fell back to English."
      +                          }
      +                        },
      +                        "required": [
      +                          "basket_key",
      +                          "customs_code",
      +                          "label",
      +                          "segments"
      +                        ],
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "Residual customs codes related to this code: those directly under a digit code (its XX code plus one reason group per reason letter), or the letter codes inside a reason group."
      +                },
      +                "residual_kind": {
      +                  "anyOf": [
      +                    {
      +                      "enum": [
      +                        "xx",
      +                        "letter"
      +                      ],
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "Residual class for residual spellings: 'xx' or 'letter' (reason groups report 'letter', the class of the codes they group)."
      +                },
      +                "residual_reason": {
      +                  "anyOf": [
      +                    {
      +                      "enum": [
      +                        "A",
      +                        "B",
      +                        "C",
      +                        "E",
      +                        "F",
      +                        "I",
      +                        "M",
      +                        "P",
      +                        "R",
      +                        "S",
      +                        "T",
      +                        "V",
      +                        "W",
      +                        "Y"
      +                      ],
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "The reason letter of a letter code or reason group (S, Y, E, I, …)."
      +                },
      +                "residual_spelling": {
      +                  "anyOf": [
      +                    {
      +                      "enum": [
      +                        "xx",
      +                        "letter",
      +                        "reason_group"
      +                      ],
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "The residual spelling's exact shape: 'xx', 'letter' or 'reason_group'."
      +                },
      +                "segment_history": {
      +                  "anyOf": [
      +                    {
      +                      "items": {
      +                        "additionalProperties": false,
      +                        "description": "Every recorded definition of one customs code (the CN classification\nfiles), independent of the current edition.",
      +                        "properties": {
      +                          "customs_code": {
      +                            "description": "The base customs code.",
      +                            "type": "string"
      +                          },
      +                          "metadata_generation": {
      +                            "anyOf": [
      +                              {
      +                                "type": "integer"
      +                              },
      +                              {
      +                                "type": "null"
      +                              }
      +                            ],
      +                            "description": "The classification snapshot the history comes from."
      +                          },
      +                          "segments": {
      +                            "description": "The definitions, oldest first.",
      +                            "items": {
      +                              "additionalProperties": false,
      +                              "description": "One recorded definition of a customs code with its direct recorded\nlinks (``SegmentHistoryPayload.segments``).",
      +                              "properties": {
      +                                "customs_code": {
      +                                  "description": "The customs code the segment defines.",
      +                                  "type": "string"
      +                                },
      +                                "kind": {
      +                                  "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded').",
      +                                  "enum": [
      +                                    "cn",
      +                                    "residual_xx",
      +                                    "letter_coded",
      +                                    "chapter_00",
      +                                    "other"
      +                                  ],
      +                                  "type": "string"
      +                                },
      +                                "label": {
      +                                  "description": "The segment's own label (the definition in force during its window), in the requested language when available.",
      +                                  "type": "string"
      +                                },
      +                                "label_lang": {
      +                                  "description": "The label's language (English when the requested one is not recorded for this definition).",
      +                                  "enum": [
      +                                    "bg",
      +                                    "cs",
      +                                    "da",
      +                                    "de",
      +                                    "el",
      +                                    "en",
      +                                    "es",
      +                                    "et",
      +                                    "fi",
      +                                    "fr",
      +                                    "ga",
      +                                    "hr",
      +                                    "hu",
      +                                    "it",
      +                                    "lt",
      +                                    "lv",
      +                                    "mt",
      +                                    "nl",
      +                                    "pl",
      +                                    "pt",
      +                                    "ro",
      +                                    "sk",
      +                                    "sl",
      +                                    "sv"
      +                                  ],
      +                                  "type": "string"
      +                                },
      +                                "recorded_links": {
      +                                  "additionalProperties": false,
      +                                  "description": "Direct correspondence edges recorded for this exact definition. An empty list means no recorded direct link -- not that the code never changed (headings have no edges of their own).",
      +                                  "properties": {
      +                                    "predecessors": {
      +                                      "description": "Edges recorded into this segment.",
      +                                      "items": {
      +                                        "additionalProperties": false,
      +                                        "description": "One recorded predecessor/successor edge of an exact segment.",
      +                                        "properties": {
      +                                          "customs_code": {
      +                                            "description": "The other segment's customs code.",
      +                                            "type": "string"
      +                                          },
      +                                          "marker": {
      +                                            "description": "Eurostat's relation marker, as recorded.",
      +                                            "type": "string"
      +                                          },
      +                                          "match": {
      +                                            "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment).",
      +                                            "enum": [
      +                                              "matched",
      +                                              "unmatched"
      +                                            ],
      +                                            "type": "string"
      +                                          },
      +                                          "valid_from": {
      +                                            "description": "The other segment's window start, ISO date.",
      +                                            "type": "string"
      +                                          },
      +                                          "valid_to": {
      +                                            "anyOf": [
      +                                              {
      +                                                "type": "string"
      +                                              },
      +                                              {
      +                                                "type": "null"
      +                                              }
      +                                            ],
      +                                            "description": "The other segment's window end, ISO date; null when open."
      +                                          }
      +                                        },
      +                                        "required": [
      +                                          "customs_code",
      +                                          "valid_from",
      +                                          "valid_to",
      +                                          "marker",
      +                                          "match"
      +                                        ],
      +                                        "type": "object"
      +                                      },
      +                                      "type": "array"
      +                                    },
      +                                    "successors": {
      +                                      "description": "Edges recorded from this segment.",
      +                                      "items": {
      +                                        "additionalProperties": false,
      +                                        "description": "One recorded predecessor/successor edge of an exact segment.",
      +                                        "properties": {
      +                                          "customs_code": {
      +                                            "description": "The other segment's customs code.",
      +                                            "type": "string"
      +                                          },
      +                                          "marker": {
      +                                            "description": "Eurostat's relation marker, as recorded.",
      +                                            "type": "string"
      +                                          },
      +                                          "match": {
      +                                            "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment).",
      +                                            "enum": [
      +                                              "matched",
      +                                              "unmatched"
      +                                            ],
      +                                            "type": "string"
      +                                          },
      +                                          "valid_from": {
      +                                            "description": "The other segment's window start, ISO date.",
      +                                            "type": "string"
      +                                          },
      +                                          "valid_to": {
      +                                            "anyOf": [
      +                                              {
      +                                                "type": "string"
      +                                              },
      +                                              {
      +                                                "type": "null"
      +                                              }
      +                                            ],
      +                                            "description": "The other segment's window end, ISO date; null when open."
      +                                          }
      +                                        },
      +                                        "required": [
      +                                          "customs_code",
      +                                          "valid_from",
      +                                          "valid_to",
      +                                          "marker",
      +                                          "match"
      +                                        ],
      +                                        "type": "object"
      +                                      },
      +                                      "type": "array"
      +                                    }
      +                                  },
      +                                  "required": [
      +                                    "successors",
      +                                    "predecessors"
      +                                  ],
      +                                  "type": "object"
      +                                },
      +                                "untranslated": {
      +                                  "anyOf": [
      +                                    {
      +                                      "type": "boolean"
      +                                    },
      +                                    {
      +                                      "type": "null"
      +                                    }
      +                                  ],
      +                                  "default": null,
      +                                  "description": "True when the label fell back to English."
      +                                },
      +                                "valid_from": {
      +                                  "description": "First day of the segment's validity window, ISO date.",
      +                                  "type": "string"
      +                                },
      +                                "valid_to": {
      +                                  "anyOf": [
      +                                    {
      +                                      "type": "string"
      +                                    },
      +                                    {
      +                                      "type": "null"
      +                                    }
      +                                  ],
      +                                  "description": "Last day of the window, ISO date; null for a segment still in force."
      +                                }
      +                              },
      +                              "required": [
      +                                "customs_code",
      +                                "valid_from",
      +                                "valid_to",
      +                                "kind",
      +                                "label",
      +                                "label_lang",
      +                                "recorded_links"
      +                              ],
      +                              "type": "object"
      +                            },
      +                            "type": "array"
      +                          }
      +                        },
      +                        "required": [
      +                          "customs_code",
      +                          "metadata_generation",
      +                          "segments"
      +                        ],
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "Every recorded definition of the code, with direct recorded links; null when no classification history is recorded for it. Use these windows to compose windowed pieces (the basket request form)."
      +                }
      +              },
      +              "required": [
      +                "customs_code",
      +                "levels",
      +                "customs_code_label",
      +                "has_subcodes",
      +                "interpreted_from",
      +                "residual_kind",
      +                "residual_spelling",
      +                "residual_reason",
      +                "in_eurostat_api",
      +                "residual_customs_codes",
      +                "in_current_cn",
      +                "segment_history"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "description": "One batch item's failure shape.",
      +              "properties": {
      +                "customs_code": {
      +                  "description": "The input item as typed.",
      +                  "type": "string"
      +                },
      +                "error": {
      +                  "additionalProperties": false,
      +                  "description": "Why it failed.",
      +                  "properties": {
      +                    "detail": {
      +                      "description": "The error message.",
      +                      "type": "string"
      +                    },
      +                    "status": {
      +                      "description": "The HTTP status the single-code endpoint would have returned.",
      +                      "type": "integer"
      +                    }
      +                  },
      +                  "required": [
      +                    "status",
      +                    "detail"
      +                  ],
      +                  "type": "object"
      +                }
      +              },
      +              "required": [
      +                "customs_code",
      +                "error"
      +              ],
      +              "type": "object"
      +            }
      +          ]
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "results"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Added

TDQS

A3.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is covered. The description adds genuinely behavioral context beyond that: batch calls degrade gracefully by returning a per-code error pair rather than failing wholesale, which tells the agent partial failure is expected and inspectable. It stops short of noting limits on invalid or unknown codes beyond that error shape.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose and then the two response shapes, with no filler. It is slightly return-value heavy given an output schema already exists, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a fully documented schema, an output schema, and annotations covering the safety profile, the description only needs to orient the agent, which it does. The one substantive gap is sibling routing, which is already penalized under usage guidelines rather than completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the comma-separated list, the 50-code cap and the 'TOTAL' literal all documented in the schema, and the lang enum fully enumerated. The description's mention of a comma-separated list restates schema content rather than adding syntax or constraint detail, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb pair and resource: 'Validate and describe one or more Combined Nomenclature codes.' That is unambiguous about what the tool does. It does not, however, distinguish itself from close siblings such as resolve_product_code or search_customs_codes, so an agent must infer the boundary from names alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to reach for this tool versus resolve_product_code or search_customs_codes, and no preconditions or exclusions are given. The only usage-like signal is the incidental mention of single-vs-list input modes, which is input mechanics rather than guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources