{
  "endpoint": "/mcp",
  "instructions": "\n> EU Trade Explorer MCP bridge for Eurostat Comext customs trade and PRODCOM industrial production.\n\n## Access\n\nTool calls and resource reads use OAuth 2.1 or a personal API key with a free account. Discovery and listings are public. See [chatbots and API access](https://tradedashboard.eu/faq-en.html#chatbots) and [data sources](https://tradedashboard.eu/about-en.html).\n\n## Tool discovery\n\nThe initial listing pins the common product-resolution, coverage, overview and documentation tools. For every other analysis, call `search_tools` with a natural-language description. It returns at most three matching tools with their complete input schemas. Execute a match through `call_tool` with `name` set to the returned tool name and `arguments` set to that tool's keyword arguments. Existing clients may still call every canonical tool name directly.\n\nSearch results omit bulky output schemas and carry a `contractUrl` instead. The [complete MCP contract](https://mcp.tradedashboard.eu/contract.json) preserves every input and output schema.\n\n## Tool results\n\nTyped tools return structured content in a stable `{\"result\": ...}` envelope. Report-section tools put the section there; `get_full_report` puts the shared query and all five sections there.\n\n## Documentation\n\nCall `get_documentation` or read `eu-trade://docs/<topic>` for a short guide and website links. Topics: `query-model`, `customs-codes`, `prodcom`, `methodology`, `reporting`.\n",
  "discovery": {
    "pinnedTools": [
      "get_documentation",
      "get_data_range",
      "get_overview",
      "resolve_product_code"
    ],
    "searchTool": "search_tools",
    "callTool": "call_tool",
    "maxSearchResults": 3,
    "contractUrl": "https://mcp.tradedashboard.eu/contract.json"
  },
  "documentation": {
    "query-model": {
      "resource": "eu-trade://docs/query-model",
      "text": "# Query model\n\nAnalytical tools share the `DashboardQuery` object shown in the pinned `get_overview` input schema and in analytical `search_tools` results. Supply exactly one of `customs_code` or `baskets`:\n\n- `customs_code` accepts one code or a list and creates one full-period basket per code.\n- A piece contains a customs code and an optional inclusive month window.\n- A basket sums its pieces into one displayed line. Use windowed pieces to select a historical segment or connect successor codes across a CN redefinition.\n\nEach piece must fall within the requested period. Overlap between equal or prefix-related codes is rejected within a basket or aggregate view. Compose historical selections from `validate_customs_code.segment_history`; the API validates the resulting selection and reports conflicts.\n\nThe schemas list defaults, bounds and field-specific rules. `get_countries` supplies valid reporter and partner names. `get_data_range` shows available months. Set `compact=true` to replace long numeric series with first/last/min/max/mean/pct_change summaries. Use full series for shock and outlier analysis.\n\nMore: [query setup and API access](https://tradedashboard.eu/faq-en.html) · [data sources](https://tradedashboard.eu/about-en.html)\n"
    },
    "customs-codes": {
      "resource": "eu-trade://docs/customs-codes",
      "text": "# Customs codes\n\nUse `resolve_product_code` to find and validate codes. `validate_customs_code` returns labels, hierarchy and `segment_history` for composing historical selections.\n\nResidual customs codes record trade published above CN8 through confidentiality, estimation, simplified declarations or HS6-only reporting. They contribute at their own level and to their ancestors; CN8 selections exclude them. You can query residual codes and reason groups directly, such as `850440XX`, `85SSS999` and `85SSS`.\n\nFor single 2/4/6-digit selections, response headers include `residual_share`: the portion of total value held in residual codes. A high share limits sub-code breakdown coverage. Long series can change residual composition at coding-regime boundaries while totals remain continuous.\n\nMore: [finding customs codes](https://tradedashboard.eu/faq-en.html#customscode) · [COMEXT granularity](https://tradedashboard.eu/methodology-en.html)\n"
    },
    "prodcom": {
      "resource": "eu-trade://docs/prodcom",
      "text": "# PRODCOM\n\nProduction and autonomy tools join Comext trade with PRODCOM production. A customs code can map to several PRODCOM codes. Responses aggregate eligible mappings and can use the nearest data-carrying ancestor when detail is suppressed. Use `query.prodcom_code` to select one mapping explicitly, and read the response's availability, reliability and mapping notes.\n\nProduction-only tools accept one plain, full-period customs code per call. The three vulnerability indicators also support multi-code comparisons. Windowed or multi-piece baskets return `segment_prodcom_unavailable` because the CN→PRODCOM correspondence has no month windows.\n\nA total over several PRODCOM codes is null when any code is withheld or missing; recorded zeros remain 0. Read `data_status.availability` for null reasons and `reliability` for caveats. Production HHI is computed over observed reporters (see `observed_reporters` and `blocked_reporters`). `prodcom.quantity_units` gives the unit of the quantity totals period by period; a total holding a quantity in one of a period's `other_units` is null (`different_unit`), and figures in periods with different units are not comparable. Export propensity and subcontracting intensity can legitimately exceed 100%. The own/subcontracted production split starts in 2021.\n\nMore: [data granularity and confidentiality](https://tradedashboard.eu/methodology-en.html) · [PRODCOM data source and update schedule](https://tradedashboard.eu/about-en.html)\n"
    },
    "methodology": {
      "resource": "eu-trade://docs/methodology",
      "text": "# Methodology\n\n## Indicator formulas and interpretation\n\n- **HHI**: sum of squared percentage shares, from 0 (spread) to 10,000 (one entity holds all value).\n- **RSCA**: `RCA = (x_p / x_total) / (X_p / X_total)` and `RSCA = (RCA - 1) / (RCA + 1)`, where `x` is a Member State's intra-EU exports and `X` is the EU total. It ranges from -1 (under-specialised) through 0 (EU average) to +1 (strongly specialised).\n- **CV**: standard deviation divided by mean for an entity/customs-code pair. Zero-activity periods are excluded.\n- **Supply and price shocks**: events are measured against each pair's own historical variability. Their responses include the event phases, magnitude, abnormality and underlying series.\n- **Pattern shifts**: before/after quadrants combine quantity and price changes: demand-driven growth, supply constraint, dumping/oversupply risk, or contraction.\n- **NIR**: `(Imports - Exports) / (Production + Imports - Exports)`. Positive values show the import share of apparent consumption; negative values indicate net exports.\n- **Trade intensity**: `(Imports + Exports) / (Imports + Production)`. Higher values indicate greater trade exposure.\n- **Export propensity**: `Exports / Production`. Values above 100% are valid when re-exports, stock drawdown or scope differences apply.\n- **Subcontracting intensity**: subcontracted production divided by total sold production. The own/subcontracted split starts in 2021.\n\n## Reporting caveats\n\nRotterdam and Antwerp can make the Netherlands and Belgium appear disproportionately large as importers because goods clear customs there before moving to their final destination. Account for this entry-point effect when interpreting country rankings, reporter breakdowns and specialisation.\n\nCOMEXT follows a monthly publication cycle, and recent months can be incomplete while declarations catch up. A sharp quantity drop near the end of a series can signal reporting lag; check coverage before treating it as a market contraction.\n\nThe website explains COMEXT/PRODCOM granularity, CIF versus FOB prices, and the Rotterdam effect. Review those pages before drawing country- or price-level conclusions.\n\nMore: [methodology](https://tradedashboard.eu/methodology-en.html) · [data sources and update schedule](https://tradedashboard.eu/about-en.html)\n"
    },
    "reporting": {
      "resource": "eu-trade://docs/reporting",
      "text": "\n> EU Trade Explorer MCP bridge for Eurostat Comext customs trade and PRODCOM industrial production.\n\n## Short report\n\n1. Call `resolve_product_code` with a product description or customs code.\n2. Find `get_full_report` through `search_tools`, then execute it through `call_tool` with the resulting query. Its `result` contains the shared query and five sections with narrative facts, chart data and dashboard links.\n3. Check `residual_share`, availability notes and the methodological caveats before writing conclusions. For annual PRODCOM narrative summaries, attach values to their `first_year`, `last_year`, `min_year` or `max_year`, never to assumed query endpoints.\n\nMore: [example reports](https://tradedashboard.eu/reports/catalogs/index.html) · [methodology](https://tradedashboard.eu/methodology-en.html)\n\n## Long report\n\nStart with `resolve_product_code`, `get_data_range` and `get_overview`. Use `search_tools` to discover the relevant analyses below, then execute them through `call_tool`:\n\n- Partners and reporters: `get_partner_detail`, `get_reporter_detail`, `get_reporter_benchmark`, `get_map_data`, `get_top_entities`.\n- Structure: `get_concentration`, `get_concentration_compare`, `get_concentration_map`, `get_specialisation`, `get_production_series`, `get_production_concentration`.\n- Sub-codes: `get_subcode_compare`.\n- Volatility: `get_volatility`, `get_supply_shocks`, `get_price_shocks`, `get_pattern_shift`.\n- Autonomy: `get_net_import_reliance`, `get_trade_intensity`, `get_export_propensity`, `get_subcontracting`, `get_subcontracting_reporters`.\n- Report sections: `get_customs_code_profile`, `get_market_summary`, `get_market_structure_summary`, `get_volatility_summary`, `get_autonomy_summary`.\n\nEach report-section tool returns its section under `result`. Cite the ready-made dashboard links returned with report facts. For annual PRODCOM narrative summaries, attach values to their `first_year`, `last_year`, `min_year` or `max_year`, never to assumed query endpoints. The [dashboard](https://tradedashboard.eu/) provides the corresponding interactive views.\n\nMore: [example reports](https://tradedashboard.eu/reports/catalogs/index.html) · [methodology](https://tradedashboard.eu/methodology-en.html) · [query help](https://tradedashboard.eu/faq-en.html)\n"
    }
  },
  "tools": [
    {
      "name": "get_documentation",
      "description": "Read one complete MCP guide: `query-model` (access, shared query\nfields, pieces and baskets), `customs-codes` (segments, residuals and\nhistorical selections), `prodcom` (production mappings, suppression and\navailability), `methodology` (indicator formulas and interpretation), or\n`reporting` (short/long workflows and dashboard navigation). The same\ncanonical text is available as `eu-trade://docs/<topic>` resources.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "DocumentationTopic": {
            "description": "Short MCP guides with links to detailed website documentation.",
            "enum": [
              "query-model",
              "customs-codes",
              "prodcom",
              "methodology",
              "reporting"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "topic": {
            "$ref": "#/$defs/DocumentationTopic"
          }
        },
        "required": [
          "topic"
        ],
        "type": "object"
      },
      "outputSchema": {
        "properties": {
          "result": {
            "type": "string"
          }
        },
        "required": [
          "result"
        ],
        "type": "object",
        "x-fastmcp-wrap-result": true
      }
    },
    {
      "name": "guidelines_for_a_short_report",
      "description": "Read this first for a quick report. Returns the short-report\nworkflow: resolve a product code, then call `get_full_report` for the\nfive most important report sections in one shot -- enough for a quick,\nsimple report. Also covers access, the shared `query` object and\nthe `compact` option.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {},
        "type": "object"
      },
      "outputSchema": {
        "properties": {
          "result": {
            "type": "string"
          }
        },
        "required": [
          "result"
        ],
        "type": "object",
        "x-fastmcp-wrap-result": true
      }
    },
    {
      "name": "guidelines_for_a_long_report",
      "description": "Read this first for an in-depth report. Returns the long-report\nworkflow: which of the 35+ tools to combine per angle (partners,\nconcentration, volatility & shocks, autonomy), the dashboard menu/tab\nstructure for pointing readers at views, and the methodological notes\nneeded to interpret and cite figures correctly. Call this before\nguessing at tool use.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {},
        "type": "object"
      },
      "outputSchema": {
        "properties": {
          "result": {
            "type": "string"
          }
        },
        "required": [
          "result"
        ],
        "type": "object",
        "x-fastmcp-wrap-result": true
      }
    },
    {
      "name": "get_countries",
      "description": "Reference data for reporters/partners: selectable EU/Euro-area/Member\nStates, named partner presets, predefined reporter/partner groups, and\nper-language country-name translations. Use this to find valid values\nfor the `reporter`, `partner_set`, `partners` and `group_reporters`\nfields used throughout the other tools' `query` argument.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {},
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CountriesResponse": {
            "additionalProperties": false,
            "description": "GET /api/reference/countries — country reference data for the sidebar\nselectors.",
            "properties": {
              "reporters": {
                "description": "Selectable reporters (EU Member States).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "reporter_presets": {
                "description": "The aggregate reporter presets (EU, euro area, candidates).",
                "items": {
                  "$ref": "#/$defs/ReporterPreset"
                },
                "type": "array"
              },
              "candidate_reporters": {
                "description": "EU candidate countries, selectable as reporters.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "other_reporters": {
                "description": "Other selectable reporters (Northern Ireland).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "reporter_groups": {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "Predefined reporter groups: {group name: [reporters]}.",
                "type": "object"
              },
              "partner_presets": {
                "description": "Named partner-set presets (e.g. 'non-EU countries').",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "partner_groups": {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "Predefined partner groups: {group name: [partners]}.",
                "type": "object"
              },
              "all_partners": {
                "description": "Every selectable partner country.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "eu_countries": {
                "description": "The EU Member States.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "translations": {
                "additionalProperties": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "description": "{English name: {lang: translated name}} for every individual country.",
                "type": "object"
              }
            },
            "required": [
              "reporters",
              "reporter_presets",
              "candidate_reporters",
              "other_reporters",
              "reporter_groups",
              "partner_presets",
              "partner_groups",
              "all_partners",
              "eu_countries",
              "translations"
            ],
            "type": "object"
          },
          "ReporterPreset": {
            "additionalProperties": false,
            "description": "An aggregate reporter preset (rendered via its i18n ``key``; ``name``\nis the English identifier submitted back as ``reporter``).",
            "properties": {
              "key": {
                "description": "The frontend's i18n key for the preset's label.",
                "type": "string"
              },
              "name": {
                "description": "The English identifier submitted back as 'reporter'.",
                "type": "string"
              }
            },
            "required": [
              "key",
              "name"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "$ref": "#/$defs/CountriesResponse"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_chapters",
      "description": "List all top-level Combined Nomenclature chapters (2-digit codes).\n\nBootstraps browsing the nomenclature top-down; drill into a chapter with\n`get_subtree`.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {
          "lang": {
            "default": "en",
            "description": "Language for translated labels in the response; any other language is refused.",
            "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"
          }
        },
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "ChaptersResponse": {
            "additionalProperties": false,
            "description": "GET /api/reference/chapters — the top-level CN chapters.",
            "properties": {
              "chapters": {
                "description": "Every top-level CN chapter (2-digit code).",
                "items": {
                  "$ref": "#/$defs/CodeLabel_CustomsCode_"
                },
                "type": "array"
              }
            },
            "required": [
              "chapters"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "$ref": "#/$defs/ChaptersResponse"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_subtree",
      "description": "Return the Combined Nomenclature sub-tree rooted at `customs_code`\n(its sub-codes, and their sub-codes, ...), each with a `customs_code`\nand a `text` description. Use this to see whether a heading you're\nabout to use (e.g. as `query.customs_code` elsewhere) is actually a\nclean match, or bundles several distinct sub-codes together.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {
          "customs_code": {
            "description": "Combined Nomenclature code to expand, e.g. '7010'.",
            "type": "string"
          },
          "lang": {
            "default": "en",
            "description": "Language for translated labels in the response; any other language is refused.",
            "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"
          }
        },
        "required": [
          "customs_code"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "SubtreeNode": {
            "additionalProperties": false,
            "description": "One node of a CN sub-tree (recursive). The optional flags are sparse\non the wire: present when true (``siblings``: for catch-all nodes),\nabsent otherwise.",
            "properties": {
              "customs_code": {
                "description": "The node's customs code.",
                "type": "string"
              },
              "text": {
                "description": "The code's label, in the requested language.",
                "type": "string"
              },
              "children": {
                "description": "The code's sub-codes.",
                "items": {
                  "$ref": "#/$defs/SubtreeNode"
                },
                "type": "array"
              },
              "untranslated": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True when the label fell back to English."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') node."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all ('other') node, the ordinary siblings it excludes."
              }
            },
            "required": [
              "customs_code",
              "text",
              "children"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "$ref": "#/$defs/SubtreeNode"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "validate_customs_code",
      "description": "Validate and describe one or more Combined Nomenclature codes.\n\nFor a single code, returns the full hierarchy of description levels\n(`levels`), the resolved `customs_code_label`, and `has_subcodes`. For a\ncomma-separated list, returns `{\"results\": [...]}` with one entry per\ncode (each either a success dict or a `{\"customs_code\", \"error\"}` pair).",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {
          "customs_code": {
            "description": "One customs code, or a comma-separated list of up to 50 codes (e.g. '73030010, 73030090'). The literal 'TOTAL' is also accepted.",
            "type": "string"
          },
          "lang": {
            "default": "en",
            "description": "Language for translated labels in the response; any other language is refused.",
            "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"
          }
        },
        "required": [
          "customs_code"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "RecordedLinkPayload": {
            "additionalProperties": false,
            "description": "One recorded predecessor/successor edge of an exact segment.",
            "properties": {
              "customs_code": {
                "description": "The other segment's customs code.",
                "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."
              },
              "marker": {
                "description": "Eurostat's relation marker, as recorded.",
                "type": "string"
              },
              "match": {
                "$ref": "#/$defs/WireEnum_LinkMatch_",
                "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment)."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "marker",
              "match"
            ],
            "type": "object"
          },
          "RecordedLinksPayload": {
            "additionalProperties": false,
            "properties": {
              "successors": {
                "description": "Edges recorded from this segment.",
                "items": {
                  "$ref": "#/$defs/RecordedLinkPayload"
                },
                "type": "array"
              },
              "predecessors": {
                "description": "Edges recorded into this segment.",
                "items": {
                  "$ref": "#/$defs/RecordedLinkPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "successors",
              "predecessors"
            ],
            "type": "object"
          },
          "SegmentHistoryEntry": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              },
              "recorded_links": {
                "$ref": "#/$defs/RecordedLinksPayload",
                "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)."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang",
              "recorded_links"
            ],
            "type": "object"
          },
          "SegmentHistoryPayload": {
            "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": {
                  "$ref": "#/$defs/SegmentHistoryEntry"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "metadata_generation",
              "segments"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SubcodeRow": {
            "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"
              },
              "label": {
                "description": "The label of the row's (latest) definition, in the requested language when recorded.",
                "type": "string"
              },
              "untranslated": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True when the label fell back to English."
              },
              "segments": {
                "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              },
              "residual_kind": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualKind_"
                  },
                  {
                    "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_spelling": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualSpelling_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
              },
              "residual_reason": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualReason_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
              },
              "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)."
              }
            },
            "required": [
              "basket_key",
              "customs_code",
              "label",
              "segments"
            ],
            "type": "object"
          },
          "ValidateCustomsCodeBatchResponse": {
            "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": [
                    {
                      "$ref": "#/$defs/ValidateCustomsCodeResponse"
                    },
                    {
                      "$ref": "#/$defs/ValidateCustomsCodeError"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "results"
            ],
            "type": "object"
          },
          "ValidateCustomsCodeError": {
            "additionalProperties": false,
            "description": "One batch item's failure shape.",
            "properties": {
              "customs_code": {
                "description": "The input item as typed.",
                "type": "string"
              },
              "error": {
                "$ref": "#/$defs/ValidateCustomsCodeErrorDetail",
                "description": "Why it failed."
              }
            },
            "required": [
              "customs_code",
              "error"
            ],
            "type": "object"
          },
          "ValidateCustomsCodeErrorDetail": {
            "additionalProperties": false,
            "properties": {
              "status": {
                "description": "The HTTP status the single-code endpoint would have returned.",
                "type": "integer"
              },
              "detail": {
                "description": "The error message.",
                "type": "string"
              }
            },
            "required": [
              "status",
              "detail"
            ],
            "type": "object"
          },
          "ValidateCustomsCodeResponse": {
            "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"
              },
              "levels": {
                "description": "The code's CN description hierarchy (one entry per ancestor level), in the requested language.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "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"
              },
              "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)."
              },
              "residual_kind": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualKind_"
                  },
                  {
                    "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_spelling": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualSpelling_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The residual spelling's exact shape: 'xx', 'letter' or 'reason_group'."
              },
              "residual_reason": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualReason_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The reason letter of a letter code or reason group (S, Y, E, I, …)."
              },
              "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)."
              },
              "residual_customs_codes": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/SubcodeRow"
                    },
                    "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."
              },
              "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)."
              },
              "segment_history": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/SegmentHistoryPayload"
                    },
                    "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"
          },
          "WireEnum_LinkMatch_": {
            "enum": [
              "matched",
              "unmatched"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualReason_": {
            "enum": [
              "A",
              "B",
              "C",
              "E",
              "F",
              "I",
              "M",
              "P",
              "R",
              "S",
              "T",
              "V",
              "W",
              "Y"
            ],
            "type": "string"
          },
          "WireEnum_ResidualSpelling_": {
            "enum": [
              "xx",
              "letter",
              "reason_group"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ValidateCustomsCodeResponse"
              },
              {
                "$ref": "#/$defs/ValidateCustomsCodeBatchResponse"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "search_customs_codes",
      "description": "Keyword/code search over the Combined Nomenclature (or PRODCOM).\n\nReturns ranked `{code, label, path}` candidates. Prefer\n`resolve_product_code` for a one-call keyword-or-code helper; use this\ndirectly if you specifically want the raw ranked candidate list.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {
          "q": {
            "description": "Keyword or code fragment to search for.",
            "type": "string"
          },
          "source": {
            "const": "cn",
            "default": "cn",
            "description": "Nomenclature to search. A dotted PRODCOM code (e.g. '23.13') is auto-detected either way and reverse-mapped to CN codes.",
            "type": "string"
          },
          "lang": {
            "default": "en",
            "description": "Language for translated labels in the response; any other language is refused.",
            "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"
          },
          "limit": {
            "default": 20,
            "description": "Max number of candidates to return.",
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "q"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "MatchedProdcom": {
            "additionalProperties": false,
            "description": "The PRODCOM code resolved from a dotted search query.",
            "properties": {
              "prodcom_code": {
                "description": "The resolved PRODCOM code, in dotted form.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The code's label, when the nomenclature lists one."
              }
            },
            "required": [
              "prodcom_code",
              "description"
            ],
            "type": "object"
          },
          "SearchResponse": {
            "additionalProperties": false,
            "description": "GET /api/reference/search — ranked candidates; ``matched_prodcom`` is\nset when the query was a dotted PRODCOM notation.",
            "properties": {
              "query": {
                "description": "The query as received.",
                "type": "string"
              },
              "lang": {
                "description": "The label language used.",
                "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"
              },
              "source": {
                "$ref": "#/$defs/WireEnum_SearchSource_",
                "description": "The nomenclature searched ('cn', or 'prodcom' for PRODCOM-notation queries)."
              },
              "matched_prodcom": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/MatchedProdcom"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The resolved PRODCOM code descriptor, when the query used PRODCOM notation (present even when no CN code maps)."
              },
              "results": {
                "description": "The ranked candidates.",
                "items": {
                  "$ref": "#/$defs/SearchResult"
                },
                "type": "array"
              }
            },
            "required": [
              "query",
              "lang",
              "source",
              "matched_prodcom",
              "results"
            ],
            "type": "object"
          },
          "SearchResult": {
            "additionalProperties": false,
            "description": "One ranked search candidate.",
            "properties": {
              "code": {
                "description": "The candidate's customs code.",
                "type": "string"
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The code's label, in the requested language; null for a mapped code the nomenclature does not list."
              },
              "path": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The candidate's breadcrumb: its ancestor labels joined into one string; null alongside a null label."
              },
              "via_prodcom": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The dotted PRODCOM form the match came through, for PRODCOM-notation queries."
              }
            },
            "required": [
              "code",
              "label",
              "path",
              "via_prodcom"
            ],
            "type": "object"
          },
          "WireEnum_SearchSource_": {
            "description": "The nomenclature a search ran over: the CN index, or the PRODCOM\nreverse mapping a dotted-notation query is answered from.",
            "enum": [
              "cn",
              "prodcom"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "$ref": "#/$defs/SearchResponse"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_data_range",
      "description": "Return the period coverage (`data_min`/`data_max`, 'YYYY-MM') actually\ncached for the given customs code(s) -- use before picking\n`period_start`/`period_end` so you don't request an empty window.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {
          "customs_codes": {
            "anyOf": [
              {
                "items": {
                  "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Customs code(s) to check coverage for. Omit for the overall store range."
          }
        },
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CoverageWindow": {
            "additionalProperties": false,
            "properties": {
              "data_min": {
                "description": "The first month with data inside the window ('YYYY-MM').",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "data_max": {
                "description": "The last month with data inside the window ('YYYY-MM').",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              }
            },
            "required": [
              "data_min",
              "data_max"
            ],
            "type": "object"
          },
          "DataRangeResponse": {
            "additionalProperties": false,
            "description": "GET /api/reference/data-range — cached period coverage ('YYYY-MM').",
            "properties": {
              "data_min": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The first month with data in the local store, over the codes' raw declarations (every definition)."
              },
              "data_max": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The last month with data in the local store, over the codes' raw declarations."
              },
              "selection": {
                "description": "For each piece given (the basket request form), the coverage of its window -- separate from the raw base coverage above.",
                "items": {
                  "$ref": "#/$defs/SelectedCoveragePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "data_min",
              "data_max",
              "selection"
            ],
            "type": "object"
          },
          "SelectedCoveragePayload": {
            "additionalProperties": false,
            "description": "The stored coverage of one piece: the months holding data inside its\nwindow, so gaps between definitions stay visible.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the store coverage start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the store coverage end."
              },
              "windows": {
                "description": "The months holding data inside the piece's window; an empty list means nothing is stored there.",
                "items": {
                  "$ref": "#/$defs/CoverageWindow"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "windows"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "$ref": "#/$defs/DataRangeResponse"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_overview",
      "description": "Headline figures: total import/export quantities, values and\nweighted-average prices per period, the trade balance, and a top-partner\nbreakdown. The best first call for any new customs-code/reporter slice.\nThe figures sit under `total` / `partners` / `balance`, each panel\ncarrying its own `periods` axis; the metadata (units, residual share,\nselection notes) is in `header`.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BalancePayload": {
            "additionalProperties": false,
            "description": "The trade balance (exports - imports), from ``Presenter.balance``: the\nnetted quantity and value per period, and the cells where one side of the\nsubtraction was 0-filled for being missing/null.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "quantity": {
                "description": "The period-aligned net-mass balance (exports - imports, tonnes); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "value": {
                "description": "The period-aligned value balance (exports - imports, EUR); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "incomplete": {
                "description": "Period-aligned flags marking the periods where one side of the subtraction was 0-filled for being missing/null.",
                "items": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "quantity",
              "value",
              "incomplete"
            ],
            "type": "object"
          },
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "EntityBreakdowns": {
            "additionalProperties": false,
            "description": "The top-N entity panels of the partner-/reporter-detail endpoints,\nranked by quantity and by value so the client can re-rank without a\nsecond request.",
            "properties": {
              "imports": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The import panel, ranked by quantity."
              },
              "exports": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The export panel, ranked by quantity."
              },
              "imports_by_value": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The import panel, ranked by value."
              },
              "exports_by_value": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The export panel, ranked by value."
              }
            },
            "required": [
              "imports",
              "exports",
              "imports_by_value",
              "exports_by_value"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "OverviewPayload": {
            "additionalProperties": false,
            "description": "POST /api/descriptive/overview — headline totals, trade balance and\ntop-partner breakdowns for the Overview tab.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "total": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The headline folded totals (single 'total' column)."
              },
              "partners": {
                "$ref": "#/$defs/EntityBreakdowns",
                "description": "The top-partner breakdowns, ranked by quantity and by value."
              },
              "balance": {
                "$ref": "#/$defs/BalancePayload",
                "description": "The trade balance (exports - imports)."
              },
              "has_subcodes": {
                "description": "Whether the customs code has children in the current CN edition.",
                "type": "boolean"
              },
              "supp_unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
              }
            },
            "required": [
              "header",
              "total",
              "partners",
              "balance",
              "has_subcodes",
              "supp_unit"
            ],
            "type": "object"
          },
          "PanelPayload": {
            "additionalProperties": false,
            "description": "The canonical descriptive-breakdown block (per-flow totals, per-entity\nand per-sub-code panels), from ``Presenter.panel``.\n\n``periods`` is the shared axis; ``columns`` the column order (the\nentity/sub-code ranking); each triplet field is keyed by those columns.\n``descriptions`` (subcode-compare only) maps customs-code columns to\ntheir CN labels.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "columns": {
                "description": "The column order (the entity/sub-code ranking) the triplet fields are keyed by.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "primary": {
                "$ref": "#/$defs/TripletFrames",
                "description": "The net-mass quantity / value / price view."
              },
              "supplementary": {
                "$ref": "#/$defs/SupplementaryTripletFrames",
                "description": "The supplementary-unit view (empty when no usable supplementary quantities survive)."
              },
              "descriptions": {
                "anyOf": [
                  {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Subcode-compare only: customs-code column -> its CN label."
              }
            },
            "required": [
              "periods",
              "columns",
              "primary",
              "supplementary",
              "descriptions"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SupplementaryTripletFrames": {
            "additionalProperties": false,
            "description": "The supplementary-unit view of a triplet: its own quantity and derived\nprice; the value is shared with the primary view and not repeated.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned supplementary-quantity series; null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned supplementary-unit price series; null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "TripletFrames": {
            "additionalProperties": false,
            "description": "A quantity / value / price panel: each field ``{column: [...]}``,\nparallel to the block's own ``periods`` axis.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned quantity series (trade: net mass in tonnes; production: the PRODCOM unit); null = no figure}.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned value series (EUR); null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned unit value series (value per quantity unit); null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "value",
              "price"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/OverviewPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_partner_detail",
      "description": "Per-partner import/export breakdown. For each flow, the top-N trading\npartners ranked both by quantity and by value (so you can compare\nvolume-based vs. value-based rankings), each with its own quantity,\nvalue and price time series, plus an optional 'Other' bucket.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "EntityBreakdowns": {
            "additionalProperties": false,
            "description": "The top-N entity panels of the partner-/reporter-detail endpoints,\nranked by quantity and by value so the client can re-rank without a\nsecond request.",
            "properties": {
              "imports": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The import panel, ranked by quantity."
              },
              "exports": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The export panel, ranked by quantity."
              },
              "imports_by_value": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The import panel, ranked by value."
              },
              "exports_by_value": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The export panel, ranked by value."
              }
            },
            "required": [
              "imports",
              "exports",
              "imports_by_value",
              "exports_by_value"
            ],
            "type": "object"
          },
          "EntityDetailPayload": {
            "additionalProperties": false,
            "description": "POST /api/descriptive/partner-detail and /reporter-detail — the top-N\nentity panels, ranked by quantity and by value.  ``custom_selection``\nmarks an explicit partner list (partner-detail only).",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "custom_selection": {
                "description": "True when the partners come from an explicit list rather than a preset (partner-detail only).",
                "type": "boolean"
              },
              "supp_unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
              },
              "entities": {
                "$ref": "#/$defs/EntityBreakdowns",
                "description": "The top-N partner (or Member-State) panels, per flow, ranked by quantity and by value."
              }
            },
            "required": [
              "header",
              "custom_selection",
              "supp_unit",
              "entities"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PanelPayload": {
            "additionalProperties": false,
            "description": "The canonical descriptive-breakdown block (per-flow totals, per-entity\nand per-sub-code panels), from ``Presenter.panel``.\n\n``periods`` is the shared axis; ``columns`` the column order (the\nentity/sub-code ranking); each triplet field is keyed by those columns.\n``descriptions`` (subcode-compare only) maps customs-code columns to\ntheir CN labels.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "columns": {
                "description": "The column order (the entity/sub-code ranking) the triplet fields are keyed by.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "primary": {
                "$ref": "#/$defs/TripletFrames",
                "description": "The net-mass quantity / value / price view."
              },
              "supplementary": {
                "$ref": "#/$defs/SupplementaryTripletFrames",
                "description": "The supplementary-unit view (empty when no usable supplementary quantities survive)."
              },
              "descriptions": {
                "anyOf": [
                  {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Subcode-compare only: customs-code column -> its CN label."
              }
            },
            "required": [
              "periods",
              "columns",
              "primary",
              "supplementary",
              "descriptions"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SupplementaryTripletFrames": {
            "additionalProperties": false,
            "description": "The supplementary-unit view of a triplet: its own quantity and derived\nprice; the value is shared with the primary view and not repeated.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned supplementary-quantity series; null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned supplementary-unit price series; null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "TripletFrames": {
            "additionalProperties": false,
            "description": "A quantity / value / price panel: each field ``{column: [...]}``,\nparallel to the block's own ``periods`` axis.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned quantity series (trade: net mass in tonnes; production: the PRODCOM unit); null = no figure}.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned value series (EUR); null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned unit value series (value per quantity unit); null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "value",
              "price"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/EntityDetailPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_reporter_detail",
      "description": "Per-EU-Member-State import/export breakdown -- the reporter-side\ncounterpart of `get_partner_detail`. Top-N Member States (by quantity and\nby value) with their quantity, value and price series. Aggregate\nreporters (EU, Euro area, groups) are excluded from the ranking.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "EntityBreakdowns": {
            "additionalProperties": false,
            "description": "The top-N entity panels of the partner-/reporter-detail endpoints,\nranked by quantity and by value so the client can re-rank without a\nsecond request.",
            "properties": {
              "imports": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The import panel, ranked by quantity."
              },
              "exports": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The export panel, ranked by quantity."
              },
              "imports_by_value": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The import panel, ranked by value."
              },
              "exports_by_value": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The export panel, ranked by value."
              }
            },
            "required": [
              "imports",
              "exports",
              "imports_by_value",
              "exports_by_value"
            ],
            "type": "object"
          },
          "EntityDetailPayload": {
            "additionalProperties": false,
            "description": "POST /api/descriptive/partner-detail and /reporter-detail — the top-N\nentity panels, ranked by quantity and by value.  ``custom_selection``\nmarks an explicit partner list (partner-detail only).",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "custom_selection": {
                "description": "True when the partners come from an explicit list rather than a preset (partner-detail only).",
                "type": "boolean"
              },
              "supp_unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
              },
              "entities": {
                "$ref": "#/$defs/EntityBreakdowns",
                "description": "The top-N partner (or Member-State) panels, per flow, ranked by quantity and by value."
              }
            },
            "required": [
              "header",
              "custom_selection",
              "supp_unit",
              "entities"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PanelPayload": {
            "additionalProperties": false,
            "description": "The canonical descriptive-breakdown block (per-flow totals, per-entity\nand per-sub-code panels), from ``Presenter.panel``.\n\n``periods`` is the shared axis; ``columns`` the column order (the\nentity/sub-code ranking); each triplet field is keyed by those columns.\n``descriptions`` (subcode-compare only) maps customs-code columns to\ntheir CN labels.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "columns": {
                "description": "The column order (the entity/sub-code ranking) the triplet fields are keyed by.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "primary": {
                "$ref": "#/$defs/TripletFrames",
                "description": "The net-mass quantity / value / price view."
              },
              "supplementary": {
                "$ref": "#/$defs/SupplementaryTripletFrames",
                "description": "The supplementary-unit view (empty when no usable supplementary quantities survive)."
              },
              "descriptions": {
                "anyOf": [
                  {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Subcode-compare only: customs-code column -> its CN label."
              }
            },
            "required": [
              "periods",
              "columns",
              "primary",
              "supplementary",
              "descriptions"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SupplementaryTripletFrames": {
            "additionalProperties": false,
            "description": "The supplementary-unit view of a triplet: its own quantity and derived\nprice; the value is shared with the primary view and not repeated.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned supplementary-quantity series; null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned supplementary-unit price series; null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "TripletFrames": {
            "additionalProperties": false,
            "description": "A quantity / value / price panel: each field ``{column: [...]}``,\nparallel to the block's own ``periods`` axis.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned quantity series (trade: net mass in tonnes; production: the PRODCOM unit); null = no figure}.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned value series (EUR); null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned unit value series (value per quantity unit); null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "value",
              "price"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/EntityDetailPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_reporter_benchmark",
      "description": "Every EU reporter ranked by value for one year -- the country-view\ncounterpart of `get_reporter_detail`. Returns a single-year snapshot\n(every real EU Member State's quantity, value and price per flow,\nranked by value) plus a benchmark price time series: the weighted\naverage across whichever reporters `query.reporter` resolves to (the\nwhole EU by default, or narrower when `query.reporter` is itself an\naggregate -- euro area, a named group, or an ad hoc custom group), the\ncross-reporter min/max envelope, and the selected reporter's own line\nwhen `query.reporter` is a single real Member State. Use it to answer\n\"how does this country -- or reporter group -- compare to every other\nreporter?\".",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "year": {
            "anyOf": [
              {
                "maximum": 2100,
                "minimum": 1988,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Year for the (cross-sectional) snapshot. Defaults to the latest full year with data."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "PriceBenchmarkPayload": {
            "additionalProperties": false,
            "description": "Benchmark price lines per flow, from ``Presenter.price_benchmark_series``:\n``prices`` carries the aggregate average / envelope / selected-reporter\nlines, ``extremes`` the per-period owner of each envelope edge.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "prices": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{line: period-aligned price series} -- the aggregate average, the min/max envelope and the selected reporter's line.",
                "type": "object"
              },
              "extremes": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{envelope edge: period-aligned owner of that edge (the reporter hitting the min/max that period)}.",
                "type": "object"
              },
              "supplementary": {
                "default": false,
                "description": "True when the prices are per supplementary unit rather than per tonne.",
                "type": "boolean"
              }
            },
            "required": [
              "periods",
              "prices",
              "extremes",
              "supplementary"
            ],
            "type": "object"
          },
          "ReporterBenchmarkPayload": {
            "additionalProperties": false,
            "description": "POST /api/descriptive/reporter-benchmark — per-flow single-year\nsnapshots plus the benchmark price series.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "supp_unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
              },
              "imports": {
                "$ref": "#/$defs/ReporterSnapshotPayload",
                "description": "The import cross-section for the latest full year."
              },
              "exports": {
                "$ref": "#/$defs/ReporterSnapshotPayload",
                "description": "The export cross-section for the latest full year."
              },
              "price_benchmark": {
                "$ref": "#/$defs/PriceBenchmarkPayload",
                "description": "The benchmark price series (aggregate average, envelope, selected reporter)."
              }
            },
            "required": [
              "header",
              "supp_unit",
              "imports",
              "exports",
              "price_benchmark"
            ],
            "type": "object"
          },
          "ReporterSnapshotPayload": {
            "additionalProperties": false,
            "description": "One year's per-reporter cross-section, ranked by value, from\n``Presenter.reporter_snapshot_series``.",
            "properties": {
              "year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The calendar year the cross-section is pinned to."
              },
              "entities": {
                "description": "The reporters, ranked by value.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "quantity": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{reporter: net mass (tonnes)}; null = not reported.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{reporter: value (EUR)}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{reporter: weighted-average price}; null = not reported.",
                "type": "object"
              }
            },
            "required": [
              "year",
              "entities",
              "quantity",
              "value",
              "price"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ReporterBenchmarkPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_map_data",
      "description": "Choropleth-ready aggregates: per-period totals (quantity, value,\nprice) for imports and exports, keyed by GISCO country code on both the\nreporter and partner sides.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "CrossSectionTriplet": {
            "additionalProperties": false,
            "description": "A time-collapsed quantity / value / price cross-section: each field\n``{entity: value}`` (GISCO-keyed on the map views).",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{entity: net mass (tonnes)}; null = not reported.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{entity: value (EUR)}; null = not reported.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{entity: weighted-average price}; null = not reported.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "value",
              "price"
            ],
            "type": "object"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "FlowCrossSections": {
            "additionalProperties": false,
            "description": "Per-flow cross-sections for one scope (reporters or partners).",
            "properties": {
              "imports": {
                "$ref": "#/$defs/CrossSectionTriplet",
                "description": "The import cross-sections."
              },
              "exports": {
                "$ref": "#/$defs/CrossSectionTriplet",
                "description": "The export cross-sections."
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "MapDataPayload": {
            "additionalProperties": false,
            "description": "POST /api/descriptive/map-data — choropleth aggregates.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "totals": {
                "$ref": "#/$defs/MapTotalsPayload",
                "description": "Per-reporter and per-partner cross-sections, per flow (GISCO-keyed)."
              }
            },
            "required": [
              "header",
              "totals"
            ],
            "type": "object"
          },
          "MapTotalsPayload": {
            "additionalProperties": false,
            "description": "Choropleth aggregates, from ``Presenter.map_totals``: per scope × flow,\na cross-section triplet keyed by GISCO code.",
            "properties": {
              "reporters": {
                "$ref": "#/$defs/FlowCrossSections",
                "description": "Per-reporter cross-sections (GISCO-keyed)."
              },
              "partners": {
                "$ref": "#/$defs/FlowCrossSections",
                "description": "Per-partner cross-sections (GISCO-keyed)."
              }
            },
            "required": [
              "reporters",
              "partners"
            ],
            "type": "object"
          },
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/MapDataPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_top_entities",
      "description": "Just the ordered list of top entities for a slice -- no time series.\nA lightweight helper for populating entity pickers or quickly checking\nwho the top partners/reporters are without pulling full series.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "EntityLevel": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "Flow": {
            "description": "A trade flow, as displayed; the store codes it 1 (imports) and 2\n(exports).",
            "enum": [
              "Imports",
              "Exports"
            ],
            "type": "string"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "entity_level": {
            "$ref": "#/$defs/EntityLevel",
            "default": "partner",
            "description": "Dimension to rank: 'partner' (trading partners) or 'reporter' (EU Member States)."
          },
          "flow": {
            "$ref": "#/$defs/Flow",
            "default": "Imports",
            "description": "Trade flow to use."
          },
          "n": {
            "anyOf": [
              {
                "maximum": 150,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Number of top entities to return. Defaults to query.n_top when omitted."
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "TopEntitiesPayload": {
            "additionalProperties": false,
            "description": "POST /api/descriptive/top-entities — the ranked entity list, no series.",
            "properties": {
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_",
                "description": "'partner' or 'reporter'."
              },
              "flow": {
                "$ref": "#/$defs/WireEnum_Flow_",
                "description": "'Imports' or 'Exports'."
              },
              "customs_code": {
                "description": "The queried customs code(s).",
                "type": "string"
              },
              "reporter_label": {
                "description": "The reporter's display label.",
                "type": "string"
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "entities": {
                "description": "The top entities, ranked by the requested measure.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "entity_level",
              "flow",
              "customs_code",
              "reporter_label",
              "partner_set_label",
              "entities"
            ],
            "type": "object"
          },
          "WireEnum_EntityLevel_": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "WireEnum_Flow_": {
            "description": "A trade flow, as displayed; the store codes it 1 (imports) and 2\n(exports).",
            "enum": [
              "Imports",
              "Exports"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "$ref": "#/$defs/TopEntitiesPayload"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_production_series",
      "description": "EU27 and per-country PRODCOM production series: EU quantity, EU\nproduction unit value, and the same two per reporting country (all\nDS-059358 reporters, not just EU-27, since production data carries no\ntrade columns). Country-level figures are heavily confidentiality\n-suppressed; suppressed/absent values come back as null, not zero. Use\n`query.prodcom_code` to pin a specific PRODCOM mapping when a\ncustoms code maps to several. Accepts exactly one customs code;\nmulti-code selections are rejected.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CodeHeader": {
            "additionalProperties": false,
            "description": "The customs-code block every analytical payload's ``header`` starts\nwith: what was queried and how the CN describes it.  The PRODCOM\nendpoints' whole header (their figures are annual EU/country production,\nwith no reporter or partner scope).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "EuProductionBlock": {
            "additionalProperties": false,
            "description": "EU27 production quantity, value and unit value of one basis, with the\ndata status of the EU figure -- the wire mirror of the EU\n``TripletGeoStatus``.  Arrays are parallel to the owning series' period axis.",
            "properties": {
              "quantity": {
                "description": "The period-aligned EU27 production quantity (the PRODCOM unit); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "value": {
                "description": "The period-aligned EU27 production value (EUR); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "price": {
                "description": "The period-aligned EU27 production unit value (value per quantity unit); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "data_status": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/DataStatusPayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit value's status; value and quantity read their own component cells. Null when the basis has no EU27 aggregate."
              }
            },
            "required": [
              "quantity",
              "value",
              "price",
              "data_status"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProdcomMetaPayload": {
            "additionalProperties": false,
            "description": "How a customs code resolved to PRODCOM, carried by every DS-059358\npayload: the resolved-code picker, fallback notes, the unavailability\nreason and the quantity-unit periods.  ``unavailability_type`` comes\nfrom the resolve ('not_applicable' / 'no_mapping' / 'selection_required'),\nselect ('suppressed') or fetch ('no_data') stage -- see ProdcomOps.",
            "properties": {
              "prodcom_codes": {
                "description": "The resolved PRODCOM code picker (deduplicated, data-bearing mappings); empty in multi-code mode, where each comparison entry carries its own.",
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              },
              "notes": {
                "description": "Fallback, selection and quantity-unit notes explaining the resolution.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "unavailability_type": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ProdcomUnavailability_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why no PRODCOM query can be formed or served, when it can't."
              },
              "quantity_units": {
                "description": "The unit of the quantity totals and unit values, period by period, the same on every route. Figures in spans with different units are not comparable. A production-only payload lists production units; a trade-exposure payload lists trade units too.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "prodcom_codes",
              "notes",
              "unavailability_type",
              "quantity_units"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "ProductionSeries": {
            "additionalProperties": false,
            "description": "EU27 and per-reporter production, per basis, on one annual axis.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "eu": {
                "additionalProperties": {
                  "$ref": "#/$defs/EuProductionBlock"
                },
                "description": "{basis ('total'/'own'/'sub'): the EU27 production block}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProductionBasis_"
                },
                "type": "object"
              },
              "reporters": {
                "additionalProperties": {
                  "$ref": "#/$defs/ReporterProductionBlock"
                },
                "description": "{basis: the per-country production panel}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProductionBasis_"
                },
                "type": "object"
              }
            },
            "required": [
              "periods",
              "eu",
              "reporters"
            ],
            "type": "object"
          },
          "ProductionSeriesPayload": {
            "additionalProperties": false,
            "description": "POST /api/production/series.",
            "properties": {
              "header": {
                "$ref": "#/$defs/CodeHeader",
                "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How the customs code resolved to PRODCOM: the code picker, fallback and unit notes, the unavailability reason and the quantity-unit periods."
              },
              "production": {
                "$ref": "#/$defs/ProductionSeries",
                "description": "EU27 and per-reporter production, per basis."
              }
            },
            "required": [
              "header",
              "prodcom",
              "production"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "ReporterProductionBlock": {
            "additionalProperties": false,
            "description": "Production quantity / value / unit value of one basis per reporting\ncountry, plus each country's status -- the wire mirror of the per-country\n``TripletGeoStatus``.  Each triplet field is keyed by country name; a\ncountry without data has no entry in ``data_status``.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned quantity series (trade: net mass in tonnes; production: the PRODCOM unit); null = no figure}.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned value series (EUR); null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned unit value series (value per quantity unit); null = no figure}.",
                "type": "object"
              },
              "data_status": {
                "additionalProperties": {
                  "$ref": "#/$defs/DataStatusPayload"
                },
                "description": "{country name: its per-period status}; the value and quantity components are carried separately, so a reader can tell why either one is absent.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "value",
              "price",
              "data_status"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomUnavailability_": {
            "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable).",
            "enum": [
              "not_applicable",
              "no_mapping",
              "selection_required",
              "suppressed",
              "no_data"
            ],
            "type": "string"
          },
          "WireEnum_ProductionBasis_": {
            "description": "The production basis axis: total sold production and its two\n2021-onward components, own-account and sub-contracted.",
            "enum": [
              "total",
              "own",
              "sub"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ProductionSeriesPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_subcode_compare",
      "description": "Sub-code comparison: for a single parent customs code, expands into\nits sub-codes (or, for a multi-code request, compares the entered codes\ndirectly) and returns per-subcode quantity/value/price series for both\nflows -- so each sub-code plots as its own line instead of being\naggregated away. The `breakdown` block is discriminated by `state`:\n'ok' carries the panels, a leaf code returns 'leaf' and an unexpandable\nnomenclature 'unavailable', each with a `message`.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "NoBreakdown": {
            "additionalProperties": false,
            "description": "A sub-code expansion that cannot be served: the code is a leaf in the\nrequested window.",
            "properties": {
              "state": {
                "const": "leaf",
                "type": "string"
              },
              "message": {
                "description": "Why there is no breakdown.",
                "type": "string"
              }
            },
            "required": [
              "state",
              "message"
            ],
            "type": "object"
          },
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PanelPayload": {
            "additionalProperties": false,
            "description": "The canonical descriptive-breakdown block (per-flow totals, per-entity\nand per-sub-code panels), from ``Presenter.panel``.\n\n``periods`` is the shared axis; ``columns`` the column order (the\nentity/sub-code ranking); each triplet field is keyed by those columns.\n``descriptions`` (subcode-compare only) maps customs-code columns to\ntheir CN labels.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "columns": {
                "description": "The column order (the entity/sub-code ranking) the triplet fields are keyed by.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "primary": {
                "$ref": "#/$defs/TripletFrames",
                "description": "The net-mass quantity / value / price view."
              },
              "supplementary": {
                "$ref": "#/$defs/SupplementaryTripletFrames",
                "description": "The supplementary-unit view (empty when no usable supplementary quantities survive)."
              },
              "descriptions": {
                "anyOf": [
                  {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Subcode-compare only: customs-code column -> its CN label."
              }
            },
            "required": [
              "periods",
              "columns",
              "primary",
              "supplementary",
              "descriptions"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SubcodeComparePayload": {
            "additionalProperties": false,
            "description": "POST /api/descriptive/subcode-compare — per-sub-code panels for both\nflows, or why the code has none.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "breakdown": {
                "description": "The panels ('ok'), or why there are none ('leaf', 'unavailable').",
                "discriminator": {
                  "mapping": {
                    "leaf": "#/$defs/NoBreakdown",
                    "ok": "#/$defs/SubcodePanels"
                  },
                  "propertyName": "state"
                },
                "oneOf": [
                  {
                    "$ref": "#/$defs/NoBreakdown"
                  },
                  {
                    "$ref": "#/$defs/SubcodePanels"
                  }
                ]
              }
            },
            "required": [
              "header",
              "breakdown"
            ],
            "type": "object"
          },
          "SubcodePanels": {
            "additionalProperties": false,
            "description": "The per-sub-code panels of both flows.",
            "properties": {
              "state": {
                "const": "ok",
                "default": "ok",
                "type": "string"
              },
              "subcodes": {
                "description": "Every series of the breakdown (before the top-N cut), with its label and the definitions it reads.",
                "items": {
                  "$ref": "#/$defs/SubcodeRow"
                },
                "type": "array"
              },
              "supp_unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The single supplementary unit the displayed series use, when one survives the coverage gate."
              },
              "imports": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The per-sub-code import panel."
              },
              "exports": {
                "$ref": "#/$defs/PanelPayload",
                "description": "The per-sub-code export panel."
              }
            },
            "required": [
              "state",
              "subcodes",
              "supp_unit",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "SubcodeRow": {
            "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"
              },
              "label": {
                "description": "The label of the row's (latest) definition, in the requested language when recorded.",
                "type": "string"
              },
              "untranslated": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True when the label fell back to English."
              },
              "segments": {
                "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              },
              "residual_kind": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualKind_"
                  },
                  {
                    "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_spelling": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualSpelling_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
              },
              "residual_reason": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualReason_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
              },
              "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)."
              }
            },
            "required": [
              "basket_key",
              "customs_code",
              "label",
              "segments"
            ],
            "type": "object"
          },
          "SupplementaryTripletFrames": {
            "additionalProperties": false,
            "description": "The supplementary-unit view of a triplet: its own quantity and derived\nprice; the value is shared with the primary view and not repeated.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned supplementary-quantity series; null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned supplementary-unit price series; null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "TripletFrames": {
            "additionalProperties": false,
            "description": "A quantity / value / price panel: each field ``{column: [...]}``,\nparallel to the block's own ``periods`` axis.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned quantity series (trade: net mass in tonnes; production: the PRODCOM unit); null = no figure}.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned value series (EUR); null = no figure}.",
                "type": "object"
              },
              "price": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{column: period-aligned unit value series (value per quantity unit); null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "value",
              "price"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualReason_": {
            "enum": [
              "A",
              "B",
              "C",
              "E",
              "F",
              "I",
              "M",
              "P",
              "R",
              "S",
              "T",
              "V",
              "W",
              "Y"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_ResidualSpelling_": {
            "enum": [
              "xx",
              "letter",
              "reason_group"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/SubcodeComparePayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_concentration",
      "description": "Herfindahl-Hirschman Index (HHI) of trade concentration across\npartners or Member States, per period (0 = perfectly spread, 10000 = one\nentity holds the whole market), plus the top-8-by-value share breakdown\n(rest bundled as 'Others'). Higher HHI = more dependent on a handful of\ncounterparties.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "EntityLevel": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "entity_level": {
            "$ref": "#/$defs/EntityLevel",
            "default": "partner",
            "description": "Dimension to analyse. 'partner' -- how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' -- how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', 'partner_name' is required."
          },
          "partner_name": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Partner country name (English). Required when entity_level='reporter'."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "ConcentrationPayload": {
            "additionalProperties": false,
            "description": "POST /api/concentration/concentration — per-flow HHI series.\n\n``imports`` / ``exports`` are always maps: keyed by partner name in\nreporter mode (one entry per top partner), and by the reporter label in\npartner mode (a single entry).  ``partners`` lists the keys in reporter\nmode.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_",
                "description": "'partner' or 'reporter'."
              },
              "partners": {
                "description": "The import/export map keys in reporter mode (empty in partner mode).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "imports": {
                "additionalProperties": {
                  "$ref": "#/$defs/ConcentrationSeries"
                },
                "description": "{key: import HHI pair}.",
                "type": "object"
              },
              "exports": {
                "additionalProperties": {
                  "$ref": "#/$defs/ConcentrationSeries"
                },
                "description": "{key: export HHI pair}.",
                "type": "object"
              }
            },
            "required": [
              "header",
              "entity_level",
              "partners",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "ConcentrationSeries": {
            "additionalProperties": false,
            "description": "The volume + value HHI pair for one flow.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "volume": {
                "$ref": "#/$defs/ConcentrationSide",
                "description": "The quantity-based HHI."
              },
              "value": {
                "$ref": "#/$defs/ConcentrationSide",
                "description": "The value-based HHI."
              }
            },
            "required": [
              "periods",
              "volume",
              "value"
            ],
            "type": "object"
          },
          "ConcentrationSide": {
            "additionalProperties": false,
            "description": "One indicator's HHI line plus the breakdown it is built from -- the\nwire mirror of ``core.computation.shapes.IndicatorComponents`` over a period\nSeries, with ``columns`` fixing the entity order (top-N + Others).",
            "properties": {
              "indicator": {
                "description": "The period-aligned HHI line (0-10000; higher = more concentrated).",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "columns": {
                "description": "The entity order the components are keyed by (top-N + Others).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{entity: period-aligned absolute values the HHI shares are computed from}.",
                "type": "object"
              }
            },
            "required": [
              "indicator",
              "columns",
              "components"
            ],
            "type": "object"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_EntityLevel_": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ConcentrationPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_concentration_compare",
      "description": "Partner-concentration (HHI) compared across sub-codes: one HHI\nline per sub-code rather than per flow, to see which sub-codes\ndrive a parent code's overall concentration.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "n_subcodes": {
            "default": 8,
            "description": "Max number of sub-codes to plot as separate HHI lines.",
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "ConcentrationCompareFlow": {
            "additionalProperties": false,
            "description": "One flow's per-sub-code HHI lines (volume- and value-based).",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "volume": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{sub-code: period-aligned quantity-based HHI line}.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{sub-code: period-aligned value-based HHI line}.",
                "type": "object"
              }
            },
            "required": [
              "periods",
              "volume",
              "value"
            ],
            "type": "object"
          },
          "ConcentrationComparePayload": {
            "additionalProperties": false,
            "description": "POST /api/concentration/concentration-compare — partner-concentration\ncompared across sub-codes, or why the code has none.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "breakdown": {
                "description": "The HHI lines ('ok'), or why there are none ('leaf', 'unavailable').",
                "discriminator": {
                  "mapping": {
                    "leaf": "#/$defs/NoBreakdown",
                    "ok": "#/$defs/SubcodeConcentration"
                  },
                  "propertyName": "state"
                },
                "oneOf": [
                  {
                    "$ref": "#/$defs/NoBreakdown"
                  },
                  {
                    "$ref": "#/$defs/SubcodeConcentration"
                  }
                ]
              }
            },
            "required": [
              "header",
              "breakdown"
            ],
            "type": "object"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "NoBreakdown": {
            "additionalProperties": false,
            "description": "A sub-code expansion that cannot be served: the code is a leaf in the\nrequested window.",
            "properties": {
              "state": {
                "const": "leaf",
                "type": "string"
              },
              "message": {
                "description": "Why there is no breakdown.",
                "type": "string"
              }
            },
            "required": [
              "state",
              "message"
            ],
            "type": "object"
          },
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SubcodeConcentration": {
            "additionalProperties": false,
            "description": "The per-sub-code HHI lines of both flows.",
            "properties": {
              "state": {
                "const": "ok",
                "default": "ok",
                "type": "string"
              },
              "subcodes": {
                "description": "Every series of the breakdown (before the top-N cut), with its label and the definitions it reads.",
                "items": {
                  "$ref": "#/$defs/SubcodeRow"
                },
                "type": "array"
              },
              "imports": {
                "$ref": "#/$defs/ConcentrationCompareFlow",
                "description": "The per-sub-code import HHI lines."
              },
              "exports": {
                "$ref": "#/$defs/ConcentrationCompareFlow",
                "description": "The per-sub-code export HHI lines."
              }
            },
            "required": [
              "state",
              "subcodes",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "SubcodeRow": {
            "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"
              },
              "label": {
                "description": "The label of the row's (latest) definition, in the requested language when recorded.",
                "type": "string"
              },
              "untranslated": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True when the label fell back to English."
              },
              "segments": {
                "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              },
              "residual_kind": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualKind_"
                  },
                  {
                    "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_spelling": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualSpelling_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
              },
              "residual_reason": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualReason_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
              },
              "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)."
              }
            },
            "required": [
              "basket_key",
              "customs_code",
              "label",
              "segments"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualReason_": {
            "enum": [
              "A",
              "B",
              "C",
              "E",
              "F",
              "I",
              "M",
              "P",
              "R",
              "S",
              "T",
              "V",
              "W",
              "Y"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_ResidualSpelling_": {
            "enum": [
              "xx",
              "letter",
              "reason_group"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ConcentrationComparePayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_concentration_map",
      "description": "Cross-sectional HHI per country for one year -- the choropleth\ncounterpart of get_concentration. 'partner' entity_level = for every EU\nmember state, HHI of its trade across partners; 'reporter' = for every\npartner, HHI of its trade across EU member states (subject to the\nRotterdam/Antwerp entry-point distortion).",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "EntityLevel": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "year": {
            "anyOf": [
              {
                "maximum": 2100,
                "minimum": 1988,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Year for the (cross-sectional) snapshot. Defaults to the latest full year with data."
          },
          "entity_level": {
            "$ref": "#/$defs/EntityLevel",
            "default": "partner",
            "description": "Dimension to analyse. 'partner' -- how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' -- how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', 'partner_name' is required."
          },
          "partner_name": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Partner country name (English). Required when entity_level='reporter'."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "ConcentrationMapPayload": {
            "additionalProperties": false,
            "description": "POST /api/concentration/concentration-map — cross-sectional HHI per\ncountry for one year.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_",
                "description": "'partner' or 'reporter'."
              },
              "year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The calendar year the cross-section is pinned to (latest full year when omitted); null when no full year exists."
              },
              "imports": {
                "$ref": "#/$defs/IndicatorCrossSections",
                "description": "The import HHI cross-sections."
              },
              "exports": {
                "$ref": "#/$defs/IndicatorCrossSections",
                "description": "The export HHI cross-sections."
              }
            },
            "required": [
              "header",
              "entity_level",
              "year",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "IndicatorCrossSections": {
            "additionalProperties": false,
            "description": "Per-indicator cross-sections (quantity / value) keyed by GISCO code.",
            "properties": {
              "quantity": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{entity: quantity-based HHI}.",
                "type": "object"
              },
              "value": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{entity: value-based HHI}.",
                "type": "object"
              }
            },
            "required": [
              "quantity",
              "value"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_EntityLevel_": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ConcentrationMapPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_specialisation",
      "description": "Intra-EU revealed symmetric comparative advantage (RSCA) per Member\nState -- a Balassa index benchmarked against the EU instead of the\nworld. Runs -1 (under-specialised) to +1 (strongly specialised), value\n-based and intra-EU only. Treat with caution: intra-EU flows are\ndistorted by the Rotterdam/Antwerp quasi-transit effect.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "year": {
            "anyOf": [
              {
                "maximum": 2100,
                "minimum": 1988,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Year for the (cross-sectional) snapshot. Defaults to the latest full year with data."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SpecialisationBlock": {
            "additionalProperties": false,
            "description": "Intra-EU RSCA per Member State for one year -- the wire form of the\n``specialisation()`` result; ``rsca_map`` is the GISCO-keyed choropleth\nview of the same figures.",
            "properties": {
              "year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The calendar year the RSCA is computed for."
              },
              "reporters": {
                "additionalProperties": {
                  "$ref": "#/$defs/SpecialisationRow"
                },
                "description": "{Member State: its RSCA figures} (name-keyed, for the detail table).",
                "type": "object"
              },
              "rsca_map": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{GISCO code: RSCA} (the choropleth view; Member States without an RSCA are absent).",
                "type": "object"
              }
            },
            "required": [
              "year",
              "reporters",
              "rsca_map"
            ],
            "type": "object"
          },
          "SpecialisationPayload": {
            "additionalProperties": false,
            "description": "POST /api/concentration/specialisation.  The header's\n``reporter_label`` is null: the view spans every Member State.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "specialisation": {
                "$ref": "#/$defs/SpecialisationBlock",
                "description": "Intra-EU RSCA per Member State for the year."
              }
            },
            "required": [
              "header",
              "specialisation"
            ],
            "type": "object"
          },
          "SpecialisationRow": {
            "additionalProperties": false,
            "description": "One reporter's RSCA figures for the year (a row of the specialisation table).",
            "properties": {
              "rsca": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Revealed symmetric comparative advantage (-1 under-specialised, +1 strongly specialised)."
              },
              "rca": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The underlying Balassa index before the symmetric transform."
              },
              "prod_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The customs code's share of the reporter's trade value."
              },
              "total_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's share of the EU's trade value."
              }
            },
            "required": [
              "rsca",
              "rca",
              "prod_share",
              "total_share"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/SpecialisationPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_production_concentration",
      "description": "How concentrated production of a customs code's goods is across all\nDS-059358 reporting countries (PRODCOM; EU Member States plus\nEFTA/candidate/other reporters -- not only the EU-27). HHI of PRODVAL\nacross countries over time, plus each country's production share.\nSuppressed/absent country figures come back as null, not zero. Use\n`query.prodcom_code` to pin a specific PRODCOM mapping. Accepts exactly\none customs code; multi-code selections are rejected.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_int_": {
            "items": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CodeHeader": {
            "additionalProperties": false,
            "description": "The customs-code block every analytical payload's ``header`` starts\nwith: what was queried and how the CN describes it.  The PRODCOM\nendpoints' whole header (their figures are annual EU/country production,\nwith no reporter or partner scope).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProdcomMetaPayload": {
            "additionalProperties": false,
            "description": "How a customs code resolved to PRODCOM, carried by every DS-059358\npayload: the resolved-code picker, fallback notes, the unavailability\nreason and the quantity-unit periods.  ``unavailability_type`` comes\nfrom the resolve ('not_applicable' / 'no_mapping' / 'selection_required'),\nselect ('suppressed') or fetch ('no_data') stage -- see ProdcomOps.",
            "properties": {
              "prodcom_codes": {
                "description": "The resolved PRODCOM code picker (deduplicated, data-bearing mappings); empty in multi-code mode, where each comparison entry carries its own.",
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              },
              "notes": {
                "description": "Fallback, selection and quantity-unit notes explaining the resolution.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "unavailability_type": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ProdcomUnavailability_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why no PRODCOM query can be formed or served, when it can't."
              },
              "quantity_units": {
                "description": "The unit of the quantity totals and unit values, period by period, the same on every route. Figures in spans with different units are not comparable. A production-only payload lists production units; a trade-exposure payload lists trade units too.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "prodcom_codes",
              "notes",
              "unavailability_type",
              "quantity_units"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "ProductionConcentration": {
            "additionalProperties": false,
            "description": "Per measure × basis: the production HHI line, the country shares\nbehind it and per-geo status, on one annual axis.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ProductionHhiBlock"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "{measure: {basis: the production HHI line, its country shares and per-country status}}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "periods",
              "data"
            ],
            "type": "object"
          },
          "ProductionConcentrationPayload": {
            "additionalProperties": false,
            "description": "POST /api/production/concentration.",
            "properties": {
              "header": {
                "$ref": "#/$defs/CodeHeader",
                "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How the customs code resolved to PRODCOM: the code picker, fallback and unit notes, the unavailability reason and the quantity-unit periods."
              },
              "concentration": {
                "$ref": "#/$defs/ProductionConcentration",
                "description": "The production HHI per measure × basis."
              }
            },
            "required": [
              "header",
              "prodcom",
              "concentration"
            ],
            "type": "object"
          },
          "ProductionHhiBlock": {
            "additionalProperties": false,
            "description": "One measure × basis production HHI: the line across reporting countries,\nthe country shares behind it and each country's status.",
            "properties": {
              "indicator": {
                "description": "Observed-reporter HHI (0-10000); withheld or missing reporters are outside the denominator.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "observed_reporters": {
                "$ref": "#/$defs/CellSeries_int_",
                "description": "Per period: reporters with a usable production figure, recorded zeros included; the HHI is null if their total is zero."
              },
              "blocked_reporters": {
                "$ref": "#/$defs/CellSeries_int_",
                "description": "Per period: reporters with data but no usable production figure."
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{country name: period-aligned production share}; null = suppressed or not reported.",
                "type": "object"
              },
              "data_status": {
                "additionalProperties": {
                  "$ref": "#/$defs/DataStatusPayload"
                },
                "description": "{country name: its per-period status}, the reason behind each absent share.",
                "type": "object"
              }
            },
            "required": [
              "indicator",
              "observed_reporters",
              "blocked_reporters",
              "components",
              "data_status"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomUnavailability_": {
            "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable).",
            "enum": [
              "not_applicable",
              "no_mapping",
              "selection_required",
              "suppressed",
              "no_data"
            ],
            "type": "string"
          },
          "WireEnum_ProductionBasis_": {
            "description": "The production basis axis: total sold production and its two\n2021-onward components, own-account and sub-contracted.",
            "enum": [
              "total",
              "own",
              "sub"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ProductionConcentrationPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_volatility",
      "description": "Coefficient-of-variation (CV = stdev / mean) volatility per\npartner/reporter x customs-code pair, over inactive-period-excluded\nhistory. Higher CV = the flow swings more relative to its typical level.\nReturns per-entity CV bars (with drill-down series) and, unless\ninclude_heatmap=false, an entity x sub-code CV heatmap.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "EntityLevel": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "Flow": {
            "description": "A trade flow, as displayed; the store codes it 1 (imports) and 2\n(exports).",
            "enum": [
              "Imports",
              "Exports"
            ],
            "type": "string"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "n_top_entities": {
            "default": 15,
            "description": "Number of top entities to include in the volatility bar chart.",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "n_top_subcodes": {
            "default": 10,
            "description": "Max number of sub-codes in the entity x customs-code heatmap.",
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          },
          "include_heatmap": {
            "default": true,
            "description": "Whether to compute the entity x sub-code CV heatmap (false is faster, bar chart only).",
            "type": "boolean"
          },
          "combos": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Comma-separated flow x indicator keys to compute at once: imp-qty, imp-price, exp-qty, exp-price. When set, overrides flow/indicator and returns a dict keyed by combo."
          },
          "flow": {
            "$ref": "#/$defs/Flow",
            "default": "Imports",
            "description": "Trade flow to use."
          },
          "indicator": {
            "default": "quantity",
            "description": "Measure for single-grid mode: 'quantity' or 'price' (ignored when combos is set).",
            "enum": [
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "entity_level": {
            "$ref": "#/$defs/EntityLevel",
            "default": "partner",
            "description": "Dimension to analyse. 'partner' -- how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' -- how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', 'partner_name' is required."
          },
          "partner_name": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Partner country name (English). Required when entity_level='reporter'."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SubcodeRow": {
            "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"
              },
              "label": {
                "description": "The label of the row's (latest) definition, in the requested language when recorded.",
                "type": "string"
              },
              "untranslated": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True when the label fell back to English."
              },
              "segments": {
                "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              },
              "residual_kind": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualKind_"
                  },
                  {
                    "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_spelling": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualSpelling_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
              },
              "residual_reason": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualReason_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
              },
              "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)."
              }
            },
            "required": [
              "basket_key",
              "customs_code",
              "label",
              "segments"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "VolatilityBar": {
            "additionalProperties": false,
            "description": "One entity's aggregate CV (0–∞, dimensionless): a row of the CV bars.",
            "properties": {
              "entity": {
                "description": "The entity (partner or reporter).",
                "type": "string"
              },
              "cv": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Coefficient of variation (stdev/mean) over the window; higher = swings more relative to its typical level."
              }
            },
            "required": [
              "entity",
              "cv"
            ],
            "type": "object"
          },
          "VolatilityBars": {
            "additionalProperties": false,
            "description": "Per-entity CV bars with drill-down series, from\n``Presenter.volatility_bars``.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "ranked": {
                "description": "The per-entity CV bars, ranked.",
                "items": {
                  "$ref": "#/$defs/VolatilityBar"
                },
                "type": "array"
              },
              "series": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{entity: its period-aligned drill-down series; null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "periods",
              "ranked",
              "series"
            ],
            "type": "object"
          },
          "VolatilityGrid": {
            "additionalProperties": false,
            "description": "One flow × indicator CV view: bars + heatmap.",
            "properties": {
              "flow": {
                "$ref": "#/$defs/WireEnum_Flow_",
                "description": "'Imports' or 'Exports'."
              },
              "indicator": {
                "$ref": "#/$defs/WireEnum_Measure_",
                "description": "'quantity' or 'price'."
              },
              "bars": {
                "$ref": "#/$defs/VolatilityBars",
                "description": "The per-entity aggregate CV bars."
              },
              "heatmap": {
                "$ref": "#/$defs/VolatilityHeatmap",
                "description": "The entity × customs-code CV grid (empty when not requested)."
              }
            },
            "required": [
              "flow",
              "indicator",
              "bars",
              "heatmap"
            ],
            "type": "object"
          },
          "VolatilityHeatmap": {
            "additionalProperties": false,
            "description": "The entity × customs-code CV grid with drill-down series, from\n``Presenter.volatility_heatmap``.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "entities": {
                "description": "The heatmap's row order (entities).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "subcodes": {
                "description": "The heatmap's column order (customs codes).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "object"
                },
                "description": "{entity: {customs_code: CV}} -- the heatmap grid; null = not computable.",
                "type": "object"
              },
              "series": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{entity: its period-aligned drill-down series; null = no figure}.",
                "type": "object"
              }
            },
            "required": [
              "periods",
              "entities",
              "subcodes",
              "data",
              "series"
            ],
            "type": "object"
          },
          "VolatilityPayload": {
            "additionalProperties": false,
            "description": "POST /api/volatility/volatility — keyed by combo (``imp-qty``,\n``imp-price``, ``exp-qty``, ``exp-price``); single-grid mode is a\none-entry ``combos`` map.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_",
                "description": "'partner' or 'reporter'."
              },
              "subcodes": {
                "description": "The heatmap's sub-code series, with their labels and the definitions each reads.",
                "items": {
                  "$ref": "#/$defs/SubcodeRow"
                },
                "type": "array"
              },
              "combos": {
                "additionalProperties": {
                  "$ref": "#/$defs/VolatilityGrid"
                },
                "description": "{combo key ('imp-qty', 'imp-price', 'exp-qty', 'exp-price'): the CV grid}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_VolatilityCombo_"
                },
                "type": "object"
              }
            },
            "required": [
              "header",
              "entity_level",
              "subcodes",
              "combos"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_EntityLevel_": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "WireEnum_Flow_": {
            "description": "A trade flow, as displayed; the store codes it 1 (imports) and 2\n(exports).",
            "enum": [
              "Imports",
              "Exports"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualReason_": {
            "enum": [
              "A",
              "B",
              "C",
              "E",
              "F",
              "I",
              "M",
              "P",
              "R",
              "S",
              "T",
              "V",
              "W",
              "Y"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_ResidualSpelling_": {
            "enum": [
              "xx",
              "letter",
              "reason_group"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          },
          "WireEnum_VolatilityCombo_": {
            "description": "A flow × indicator grid of ``/volatility`` (keys shared with the\nfrontend). The four grids differ only in post-load filtering, so one\ndata load serves them all.",
            "enum": [
              "imp-qty",
              "imp-price",
              "exp-qty",
              "exp-price"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/VolatilityPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_pattern_shift",
      "description": "Before/after trade-pattern shift around a split point\n(`query.midpoint`): for each entity, compares average quantity and price\nbefore vs. after, and returns scatter points (quantity-change % vs.\nprice-change %) with quadrant labels -- top-right = demand-driven growth,\ntop-left = supply constraint/monopoly risk, bottom-right =\ndumping/oversupply risk, bottom-left = market contraction. Suggested\nworkflow: omit `query.midpoint` to receive the default analysis and every\nvalid split point in `available_midpoints`, then set one of those values as\n`query.midpoint` here. An explicit midpoint that cannot form a valid split\nreturns a 422 error frame.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "FlowBlocks": {
            "additionalProperties": false,
            "description": "Per-flow blocks, either of which may be absent (not computable).",
            "properties": {
              "imports": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/PatternShiftBlock"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The import scatter (null when not computable)."
              },
              "exports": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/PatternShiftBlock"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The export scatter (null when not computable)."
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PatternShiftBlock": {
            "additionalProperties": false,
            "description": "The before/after scatter for one entity level × flow, from\n``Presenter.pattern_shift``; ``quadrants`` labels the four corners.",
            "properties": {
              "points": {
                "description": "The scatter points, one per entity.",
                "items": {
                  "$ref": "#/$defs/PatternShiftPoint"
                },
                "type": "array"
              },
              "quadrants": {
                "additionalProperties": {
                  "$ref": "#/$defs/QuadrantLabel"
                },
                "description": "The four quadrant labels, keyed by corner.",
                "type": "object"
              }
            },
            "required": [
              "points",
              "quadrants"
            ],
            "type": "object"
          },
          "PatternShiftPayload": {
            "additionalProperties": false,
            "description": "POST /api/volatility/pattern-shift.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "midpoint": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The canonical 'YYYY-MM' split used for this response; null when no valid split exists."
              },
              "available_midpoints": {
                "description": "Every valid 'YYYY-MM' split point in observed-period order; the first and last bounds do not imply that interior gaps are valid.",
                "items": {
                  "description": "A calendar month, 'YYYY-MM'.",
                  "pattern": "\\d{4}-\\d{2}",
                  "type": "string"
                },
                "type": "array"
              },
              "partners": {
                "$ref": "#/$defs/FlowBlocks",
                "description": "The partner-level scatter, per flow."
              },
              "reporters": {
                "$ref": "#/$defs/FlowBlocks",
                "description": "The reporter-level scatter, per flow."
              }
            },
            "required": [
              "header",
              "midpoint",
              "available_midpoints",
              "partners",
              "reporters"
            ],
            "type": "object"
          },
          "PatternShiftPoint": {
            "additionalProperties": false,
            "description": "One entity's before/after shift (scatter point): a row of the\npattern-shift table.",
            "properties": {
              "entity": {
                "description": "The entity (partner or reporter).",
                "type": "string"
              },
              "qty_change_pct": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Quantity change (%) after vs before the midpoint -- the scatter's x value."
              },
              "price_change_pct": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Price change (%) after vs before the midpoint -- the scatter's y value."
              },
              "total_qty": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The entity's total quantity over the window (bubble size)."
              },
              "qty_before": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Average quantity before the midpoint."
              },
              "qty_after": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Average quantity after the midpoint."
              },
              "price_before": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Average price before the midpoint."
              },
              "price_after": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Average price after the midpoint."
              }
            },
            "required": [
              "entity",
              "qty_change_pct",
              "price_change_pct",
              "total_qty",
              "qty_before",
              "qty_after",
              "price_before",
              "price_after"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "QuadrantLabel": {
            "additionalProperties": false,
            "properties": {
              "label": {
                "description": "The quadrant's short label.",
                "type": "string"
              },
              "desc": {
                "description": "The quadrant's interpretation (e.g. demand-driven growth, supply constraint, dumping/oversupply risk, market contraction).",
                "type": "string"
              }
            },
            "required": [
              "label",
              "desc"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/PatternShiftPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_supply_shocks",
      "description": "Detect abnormal collapses in trade volumes (\"sudden volume changes\").\nFlags periods where a partner × customs-code pair's volume drops well\nbelow its historical average (>2 sigma by default). Returns ranked shock events\nper flow, each with timeline phases (baseline, decline, disruption,\nrecovery, ...), magnitude, abnormality score and underlying series.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "EntityLevel": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "entity_level": {
            "$ref": "#/$defs/EntityLevel",
            "default": "partner",
            "description": "Dimension to analyse. 'partner' -- how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' -- how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', 'partner_name' is required."
          },
          "partner_name": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Partner country name (English). Required when entity_level='reporter'."
          },
          "min_abnormality": {
            "default": 2.0,
            "description": "Minimum statistical abnormality of the volume crash, in sigma. Lower values flag more (weaker) shocks; higher values flag only extreme events. Default 2.0.",
            "maximum": 10.0,
            "minimum": 0.1,
            "type": "number"
          },
          "relative_threshold": {
            "default": 0.1,
            "description": "Minimum drop relative to peak volume to count as a collapse (e.g. 0.10 = 10% drop). Default 0.10.",
            "maximum": 0.95,
            "minimum": 0.01,
            "type": "number"
          },
          "min_active_years": {
            "default": 2,
            "description": "Consecutive years of regular trade required before a collapse can be flagged. Default 2.",
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "cumulative_share": {
            "default": 0.8,
            "description": "Only the top trading partners that together account for this share of total trade are analysed (e.g. 0.80 = top 80%). Default 0.80.",
            "maximum": 1.0,
            "minimum": 0.3,
            "type": "number"
          },
          "max_tolerated_gap": {
            "default": 2,
            "description": "Consecutive quiet periods allowed within an otherwise stable trading relationship. Default 2.",
            "maximum": 6,
            "minimum": 1,
            "type": "integer"
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PairSeries": {
            "additionalProperties": false,
            "description": "A pair's quantity and price series over the shock payload's period\naxis (the wire mirror of ``core.computation.shapes.PairSeries``).",
            "properties": {
              "quantity": {
                "description": "The period-aligned quantity series; null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "price": {
                "description": "The period-aligned price series; null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "ShockBlock": {
            "additionalProperties": false,
            "description": "One timeline phase of a shock event (the wire mirror of\n``core.computation.shapes.ShockPhase``).",
            "properties": {
              "type": {
                "$ref": "#/$defs/WireEnum_ShockBlockType_",
                "description": "The phase kind (e.g. baseline, decline, disruption, full_recovery for supply shocks; price spike/drop, volatile trade, return to baseline for price shocks)."
              },
              "start": {
                "description": "The phase's first period.",
                "format": "date",
                "type": "string"
              },
              "end": {
                "description": "The phase's last period (inclusive).",
                "format": "date",
                "type": "string"
              },
              "length": {
                "description": "The phase's length in periods.",
                "type": "integer"
              },
              "qty_mean": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Mean quantity per period over the phase (no-trade periods count as 0)."
              },
              "price_mean": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Volume-weighted mean price over the phase."
              },
              "qty_pct_to_baseline": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The phase's quantity as % of the baseline mean."
              },
              "price_pct_to_baseline": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The phase's price as % of the baseline mean."
              }
            },
            "required": [
              "type",
              "start",
              "end",
              "length",
              "qty_mean",
              "price_mean",
              "qty_pct_to_baseline",
              "price_pct_to_baseline"
            ],
            "type": "object"
          },
          "ShockEvent": {
            "additionalProperties": false,
            "description": "One detected shock: identity, magnitude vs. baseline, and the\ntimeline phases (the wire mirror of ``core.computation.shapes.DetectedShock``).",
            "properties": {
              "entity": {
                "description": "The entity (partner or reporter) the shock was detected for.",
                "type": "string"
              },
              "customs_code": {
                "description": "The customs code of the pair.",
                "type": "string"
              },
              "shift_pct": {
                "description": "The magnitude of the collapse/spike vs baseline (%).",
                "type": "number"
              },
              "baseline_cv": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The pair's usual volatility (CV) over the baseline window."
              },
              "abnormality": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "How unusual the event is vs the pair's own history (sigma for supply shocks, CV multiples for price shocks)."
              },
              "value_share": {
                "description": "The pair's share of the slice's total value.",
                "type": "number"
              },
              "center": {
                "description": "The period the shock is centred on (sharpest drop/spike).",
                "format": "date",
                "type": "string"
              },
              "series": {
                "$ref": "#/$defs/PairSeries",
                "description": "The pair's quantity/price series over the payload's period axis."
              },
              "blocks": {
                "description": "The timeline phases (empty when detection found none).",
                "items": {
                  "$ref": "#/$defs/ShockBlock"
                },
                "type": "array"
              }
            },
            "required": [
              "entity",
              "customs_code",
              "shift_pct",
              "baseline_cv",
              "abnormality",
              "value_share",
              "center",
              "series",
              "blocks"
            ],
            "type": "object"
          },
          "ShocksEndpointPayload": {
            "additionalProperties": false,
            "description": "POST /api/volatility/supply-shocks and /price-shocks.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_",
                "description": "'partner' or 'reporter'."
              },
              "imports": {
                "$ref": "#/$defs/ShocksPayload",
                "description": "The import-flow shocks."
              },
              "exports": {
                "$ref": "#/$defs/ShocksPayload",
                "description": "The export-flow shocks."
              }
            },
            "required": [
              "header",
              "entity_level",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "ShocksPayload": {
            "additionalProperties": false,
            "description": "The grouped supply-/price-shock payload -- the wire mirror of\n``core.computation.shapes.ShockIndicator`` (blocks nested under their event,\nperiods carried once).",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "events": {
                "description": "The detected shocks, ranked by abnormality.",
                "items": {
                  "$ref": "#/$defs/ShockEvent"
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "events"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_EntityLevel_": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          },
          "WireEnum_ShockBlockType_": {
            "description": "One timeline phase of a detected shock (``ComextVolatility``): the\nbaseline, the shock itself, and the aftermath.",
            "enum": [
              "baseline",
              "exit",
              "disruption",
              "decline",
              "full_recovery",
              "partial_recovery",
              "depressed",
              "sporadic",
              "price spike",
              "price drop",
              "shock",
              "volatile trade",
              "price volatility",
              "volume volatility",
              "return to baseline",
              "post shock"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ShocksEndpointPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_price_shocks",
      "description": "Detect sudden price regime shifts (\"rapid price changes\"), accounting\nfor each flow's usual volatility so naturally volatile flows aren't\nover-flagged. Returns ranked shock events per flow with timeline phases\n(price spike/drop, volatile trade, return to baseline, ...), magnitude\nand series.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "EntityLevel": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "entity_level": {
            "$ref": "#/$defs/EntityLevel",
            "default": "partner",
            "description": "Dimension to analyse. 'partner' -- how concentrated/volatile is the reporter's trade across its trading partners? 'reporter' -- how concentrated/volatile is a given partner's trade across EU Member States? When 'reporter', 'partner_name' is required."
          },
          "partner_name": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Partner country name (English). Required when entity_level='reporter'."
          },
          "min_abnormality": {
            "default": 2.0,
            "description": "Minimum statistical unusualness of the price shift compared to baseline volatility (coefficient-of-variation multiples). Lower values surface more (weaker) shocks. Default 2.0.",
            "maximum": 10.0,
            "minimum": 0.5,
            "type": "number"
          },
          "lookback_years": {
            "default": 2,
            "description": "Years before the shock used to establish the coefficient-of-variation baseline. Default 2.",
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "cumulative_share": {
            "default": 0.8,
            "description": "Only the top trading partners that together account for this share of total trade are analysed (e.g. 0.80 = top 80%). Default 0.80.",
            "maximum": 1.0,
            "minimum": 0.3,
            "type": "number"
          },
          "max_shocks_per_pair": {
            "default": 1,
            "description": "Number of non-overlapping shocks kept per trading partner. Raise to surface multiple shock events per pair. Default 1.",
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BasketPayload": {
            "additionalProperties": false,
            "description": "How one requested basket was read: its label and its pieces.",
            "properties": {
              "label": {
                "description": "The basket's display label (the caller's label, or the pieces' codes joined).",
                "type": "string"
              },
              "pieces": {
                "description": "The basket's pieces, in request order.",
                "items": {
                  "$ref": "#/$defs/PiecePayload"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "pieces"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataProvenance": {
            "additionalProperties": false,
            "description": "The published data a response was computed from.",
            "properties": {
              "store_generation": {
                "description": "The trade store's completed-build generation.",
                "type": "string"
              },
              "metadata_generation": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The CN classification snapshot's generation; null when none is published."
              }
            },
            "required": [
              "store_generation",
              "metadata_generation"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "NotePayload": {
            "additionalProperties": false,
            "description": "A structured coverage note: what the data shows or lacks for this\nslice (whatever was removed, nulled or cannot be served).",
            "properties": {
              "kind": {
                "$ref": "#/$defs/WireEnum_CoverageKind_",
                "description": "Stable identifier of the note's kind, e.g. 'reporter_coverage', 'supp_coverage_gate', 'outliers_nulled'."
              },
              "severity": {
                "$ref": "#/$defs/WireEnum_Severity_",
                "description": "'warning' when the figures are affected, 'info' otherwise."
              },
              "message": {
                "description": "Fixed English text of the kind; slice-specific facts are in args.",
                "type": "string"
              },
              "basket_refs": {
                "description": "Indexes of the requested baskets the note concerns; empty when it concerns the whole slice.",
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "args": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The note's structured facts (codes, windows, counts, shares).",
                "type": "object"
              }
            },
            "required": [
              "kind",
              "severity",
              "message",
              "basket_refs",
              "args"
            ],
            "type": "object"
          },
          "PairSeries": {
            "additionalProperties": false,
            "description": "A pair's quantity and price series over the shock payload's period\naxis (the wire mirror of ``core.computation.shapes.PairSeries``).",
            "properties": {
              "quantity": {
                "description": "The period-aligned quantity series; null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "price": {
                "description": "The period-aligned price series; null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "PiecePayload": {
            "additionalProperties": false,
            "description": "How one requested piece was read: the code, the window it was asked\nfor (a null bound = the request's), and the recorded definitions that\nwindow meets -- facts, no interpretation.",
            "properties": {
              "customs_code": {
                "description": "The piece's customs code.",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's first month, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The window's last month, ISO 'YYYY-MM'; null = the request's period_end."
              },
              "definitions": {
                "description": "The recorded definitions of the code whose window meets the piece's, oldest first: what the digits meant over the window.",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "from_month",
              "to_month",
              "definitions"
            ],
            "type": "object"
          },
          "ResidualShareNote": {
            "additionalProperties": false,
            "description": "Why ``residual_share`` is null -- so a missing share never reads as\n\"no residual trade\" (a measured zero is a share of 0.0, never null).",
            "properties": {
              "reason": {
                "$ref": "#/$defs/WireEnum_ResidualShareUnavailable_",
                "description": "Stable identifier of the reason."
              },
              "message": {
                "description": "The reason in English, naming the code where relevant.",
                "type": "string"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "type": "object"
          },
          "ResidualSharePayload": {
            "additionalProperties": false,
            "description": "The residual share of a slice (``Presenter.residual_share``):\n``by_level`` splits it across the level a residual sits directly under\n(``chapter``/``heading``/``subheading``), ``by_kind`` across its kind\n(``xx``/``letter`` -- the latter makes the 2002 letter→XX re-keying\nvisible in long series). One entry per present level/kind only.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              },
              "by_level": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by the level the residual sits directly under (chapter/heading/subheading).",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_CustomsCodeLevel_"
                },
                "type": "object"
              },
              "by_kind": {
                "additionalProperties": {
                  "$ref": "#/$defs/ResidualShareSlice"
                },
                "description": "The share split by residual kind (xx/letter) -- makes the 2002 letter→XX re-keying visible in long series.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ResidualKind_"
                },
                "type": "object"
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note",
              "by_level",
              "by_kind"
            ],
            "type": "object"
          },
          "ResidualShareSlice": {
            "additionalProperties": false,
            "description": "One residual-share figure: the part of a total's value (0-1) sitting\nin residual customs codes, plus the mass share when honestly\nmeasurable. Wire counterpart of ``core.computation.comext.residuals.ResidualShareSlice``.",
            "properties": {
              "value_share": {
                "description": "Share of the slice's total value (0-1) declared in residual customs codes.",
                "type": "number"
              },
              "quantity_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Share of the slice's total net mass (0-1) declared in residual customs codes. Null when net-mass coverage fails the all-or-nothing gate (see quantity_share_note) -- never a partial ratio."
              },
              "quantity_share_note": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why quantity_share is null, when it is."
              }
            },
            "required": [
              "value_share",
              "quantity_share",
              "quantity_share_note"
            ],
            "type": "object"
          },
          "ResponseHeader": {
            "additionalProperties": false,
            "description": "The metadata block of every Comext analytical payload (built once,\nby ``Runtime.response_header``).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              },
              "reporter_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reporter's display label; null for views spanning every reporter."
              },
              "partner_set_label": {
                "description": "The partner set's label.",
                "type": "string"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor",
                "description": "The unit of every 'quantity' series: net mass in tonnes."
              },
              "residual_share": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualSharePayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The part of the slice's total that sits in residual customs codes -- present for single 2/4/6-digit requests only; None for CN8, residual spellings, TOTAL and multi-code requests, and whenever the slice holds no total value."
              },
              "residual_share_note": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ResidualShareNote"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why residual_share is null, when it is -- so a missing share never reads as 'no residual trade'. Null whenever residual_share is present."
              },
              "in_eurostat_api": {
                "description": "False only for letter codes and reason groups: Eurostat's API rejects them as PRODUCT values, though their trade is inside the API's parent totals. True for digit and XX codes.",
                "type": "boolean"
              },
              "baskets": {
                "description": "How each requested basket was read: its label and its pieces, each with the definitions its window meets.",
                "items": {
                  "$ref": "#/$defs/BasketPayload"
                },
                "type": "array"
              },
              "notes": {
                "description": "Structured notes on the selection and on the slice: whatever was combined, removed, nulled or cannot be served.",
                "items": {
                  "$ref": "#/$defs/NotePayload"
                },
                "type": "array"
              },
              "data_provenance": {
                "$ref": "#/$defs/DataProvenance",
                "description": "Which published data produced the figures: the same selector can return different numbers after a store or classification refresh."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency",
              "reporter_label",
              "partner_set_label",
              "quantity_unit",
              "residual_share",
              "residual_share_note",
              "in_eurostat_api",
              "baskets",
              "notes",
              "data_provenance"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "ShockBlock": {
            "additionalProperties": false,
            "description": "One timeline phase of a shock event (the wire mirror of\n``core.computation.shapes.ShockPhase``).",
            "properties": {
              "type": {
                "$ref": "#/$defs/WireEnum_ShockBlockType_",
                "description": "The phase kind (e.g. baseline, decline, disruption, full_recovery for supply shocks; price spike/drop, volatile trade, return to baseline for price shocks)."
              },
              "start": {
                "description": "The phase's first period.",
                "format": "date",
                "type": "string"
              },
              "end": {
                "description": "The phase's last period (inclusive).",
                "format": "date",
                "type": "string"
              },
              "length": {
                "description": "The phase's length in periods.",
                "type": "integer"
              },
              "qty_mean": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Mean quantity per period over the phase (no-trade periods count as 0)."
              },
              "price_mean": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Volume-weighted mean price over the phase."
              },
              "qty_pct_to_baseline": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The phase's quantity as % of the baseline mean."
              },
              "price_pct_to_baseline": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The phase's price as % of the baseline mean."
              }
            },
            "required": [
              "type",
              "start",
              "end",
              "length",
              "qty_mean",
              "price_mean",
              "qty_pct_to_baseline",
              "price_pct_to_baseline"
            ],
            "type": "object"
          },
          "ShockEvent": {
            "additionalProperties": false,
            "description": "One detected shock: identity, magnitude vs. baseline, and the\ntimeline phases (the wire mirror of ``core.computation.shapes.DetectedShock``).",
            "properties": {
              "entity": {
                "description": "The entity (partner or reporter) the shock was detected for.",
                "type": "string"
              },
              "customs_code": {
                "description": "The customs code of the pair.",
                "type": "string"
              },
              "shift_pct": {
                "description": "The magnitude of the collapse/spike vs baseline (%).",
                "type": "number"
              },
              "baseline_cv": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The pair's usual volatility (CV) over the baseline window."
              },
              "abnormality": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "How unusual the event is vs the pair's own history (sigma for supply shocks, CV multiples for price shocks)."
              },
              "value_share": {
                "description": "The pair's share of the slice's total value.",
                "type": "number"
              },
              "center": {
                "description": "The period the shock is centred on (sharpest drop/spike).",
                "format": "date",
                "type": "string"
              },
              "series": {
                "$ref": "#/$defs/PairSeries",
                "description": "The pair's quantity/price series over the payload's period axis."
              },
              "blocks": {
                "description": "The timeline phases (empty when detection found none).",
                "items": {
                  "$ref": "#/$defs/ShockBlock"
                },
                "type": "array"
              }
            },
            "required": [
              "entity",
              "customs_code",
              "shift_pct",
              "baseline_cv",
              "abnormality",
              "value_share",
              "center",
              "series",
              "blocks"
            ],
            "type": "object"
          },
          "ShocksEndpointPayload": {
            "additionalProperties": false,
            "description": "POST /api/volatility/supply-shocks and /price-shocks.",
            "properties": {
              "header": {
                "$ref": "#/$defs/ResponseHeader",
                "description": "The request's metadata: customs code, labels, units, residual share, selection and notes."
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_",
                "description": "'partner' or 'reporter'."
              },
              "imports": {
                "$ref": "#/$defs/ShocksPayload",
                "description": "The import-flow shocks."
              },
              "exports": {
                "$ref": "#/$defs/ShocksPayload",
                "description": "The export-flow shocks."
              }
            },
            "required": [
              "header",
              "entity_level",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "ShocksPayload": {
            "additionalProperties": false,
            "description": "The grouped supply-/price-shock payload -- the wire mirror of\n``core.computation.shapes.ShockIndicator`` (blocks nested under their event,\nperiods carried once).",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "events": {
                "description": "The detected shocks, ranked by abnormality.",
                "items": {
                  "$ref": "#/$defs/ShockEvent"
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "events"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_CoverageKind_": {
            "description": "The kinds of coverage note.",
            "enum": [
              "reporter_coverage",
              "total_only_period",
              "unmapped_country_code",
              "no_residuals_stored",
              "outliers_nulled",
              "supp_unit_mixed",
              "supp_coverage_gate",
              "partial_bucket",
              "component_empty",
              "negative_values",
              "cn8_residual_sibling",
              "group_residual_above"
            ],
            "type": "string"
          },
          "WireEnum_CustomsCodeLevel_": {
            "enum": [
              "chapter",
              "heading",
              "subheading",
              "cn8",
              "total"
            ],
            "type": "string"
          },
          "WireEnum_EntityLevel_": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualShareUnavailable_": {
            "description": "Why a slice has no residual share (``ResidualShareNote.reason``).",
            "enum": [
              "switched_off",
              "multi_code",
              "mixed_codes",
              "pieced_basket",
              "residual_spelling",
              "total",
              "cn8_leaf",
              "no_partners",
              "no_store_data",
              "no_total_trade"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          },
          "WireEnum_Severity_": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          },
          "WireEnum_ShockBlockType_": {
            "description": "One timeline phase of a detected shock (``ComextVolatility``): the\nbaseline, the shock itself, and the aftermath.",
            "enum": [
              "baseline",
              "exit",
              "disruption",
              "decline",
              "full_recovery",
              "partial_recovery",
              "depressed",
              "sporadic",
              "price spike",
              "price drop",
              "shock",
              "volatile trade",
              "price volatility",
              "volume volatility",
              "return to baseline",
              "post shock"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ShocksEndpointPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_net_import_reliance",
      "description": "Net Import Reliance (NIR) = (Imports - Exports) / Apparent\nconsumption, annual, joining PRODCOM production with Comext trade. E.g.\n40% means 40% of EU consumption is met by imports; negative means the EU\nis a net exporter. Returns the NIR % series, its supply/disposition\ncomponents, sibling-category/per-code comparisons, the resolved PRODCOM\ncodes and availability notes (CN-to-PRODCOM mapping is not always 1:1;\nsee the `comparison.prodcom.notes` / `comparison.prodcom.unavailability_type`\nfields in the response). Use `query.prodcom_code` to pin a\nspecific mapping.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CodeHeader": {
            "additionalProperties": false,
            "description": "The customs-code block every analytical payload's ``header`` starts\nwith: what was queried and how the CN describes it.  The PRODCOM\nendpoints' whole header (their figures are annual EU/country production,\nwith no reporter or partner scope).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "ComponentStatusPayload": {
            "additionalProperties": false,
            "description": "One (measure, basis) trade-exposure result -- the wire mirror of\n``IndicatorComponentStatus``: the ratio line (``indicator``), the inputs\nit was built from (``components``) and the per-period status.  Empty (no\nperiods) when the indicator has no data.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "indicator": {
                "description": "The period-aligned indicator line; null = availability gap (see data_status).",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{input: period-aligned component series the indicator is built from}.",
                "type": "object"
              },
              "data_status": {
                "$ref": "#/$defs/DataStatusPayload",
                "description": "The per-period availability/gap/reliability verdicts and component statuses (empty arrays when the indicator has no data)."
              }
            },
            "required": [
              "periods",
              "indicator",
              "components",
              "data_status"
            ],
            "type": "object"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "EnteredCodeExposure": {
            "additionalProperties": false,
            "description": "One entered customs code of a multi-code comparison.",
            "properties": {
              "customs_code": {
                "description": "The entered customs code.",
                "type": "string"
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How it resolved to PRODCOM; unavailability_type is set when it has no usable EU27 data."
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "Its measure × basis indicator matrix; empty when unavailable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "customs_code",
              "prodcom",
              "data"
            ],
            "type": "object"
          },
          "EnteredCodesComparison": {
            "additionalProperties": false,
            "description": "Multi-code mode: the entered customs codes compared directly, plus\ntheir aggregate when it is a valid sum.",
            "properties": {
              "mode": {
                "const": "multi",
                "default": "multi",
                "type": "string"
              },
              "aggregable": {
                "description": "Whether the codes may be summed: every code has data and all their PRODCOM codes sit at one hierarchy level.",
                "type": "boolean"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "The aggregate's measure × basis indicator matrix; empty when not aggregable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              },
              "quantity_units": {
                "description": "The aggregate's quantity-unit periods.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              },
              "codes": {
                "description": "Every entered code, in request order.",
                "items": {
                  "$ref": "#/$defs/EnteredCodeExposure"
                },
                "type": "array"
              }
            },
            "required": [
              "mode",
              "aggregable",
              "data",
              "quantity_units",
              "codes"
            ],
            "type": "object"
          },
          "ExposurePayload": {
            "additionalProperties": false,
            "description": "POST /api/vulnerability/{net-import-reliance,trade-intensity,\nexport-propensity} — one shared shape; ``indicator`` says which.",
            "properties": {
              "header": {
                "$ref": "#/$defs/CodeHeader",
                "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
              },
              "indicator": {
                "$ref": "#/$defs/WireEnum_ExposureIndicator_",
                "description": "Which of the three EU27 trade-exposure indicators this payload carries."
              },
              "comparison": {
                "description": "The indicator figures: one code against its PRODCOM siblings ('single'), or the entered codes side by side ('multi').",
                "discriminator": {
                  "mapping": {
                    "multi": "#/$defs/EnteredCodesComparison",
                    "single": "#/$defs/SiblingComparison"
                  },
                  "propertyName": "mode"
                },
                "oneOf": [
                  {
                    "$ref": "#/$defs/SiblingComparison"
                  },
                  {
                    "$ref": "#/$defs/EnteredCodesComparison"
                  }
                ]
              }
            },
            "required": [
              "header",
              "indicator",
              "comparison"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProdcomMetaPayload": {
            "additionalProperties": false,
            "description": "How a customs code resolved to PRODCOM, carried by every DS-059358\npayload: the resolved-code picker, fallback notes, the unavailability\nreason and the quantity-unit periods.  ``unavailability_type`` comes\nfrom the resolve ('not_applicable' / 'no_mapping' / 'selection_required'),\nselect ('suppressed') or fetch ('no_data') stage -- see ProdcomOps.",
            "properties": {
              "prodcom_codes": {
                "description": "The resolved PRODCOM code picker (deduplicated, data-bearing mappings); empty in multi-code mode, where each comparison entry carries its own.",
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              },
              "notes": {
                "description": "Fallback, selection and quantity-unit notes explaining the resolution.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "unavailability_type": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ProdcomUnavailability_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why no PRODCOM query can be formed or served, when it can't."
              },
              "quantity_units": {
                "description": "The unit of the quantity totals and unit values, period by period, the same on every route. Figures in spans with different units are not comparable. A production-only payload lists production units; a trade-exposure payload lists trade units too.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "prodcom_codes",
              "notes",
              "unavailability_type",
              "quantity_units"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "ProdcomSibling": {
            "additionalProperties": false,
            "description": "One same-level PRODCOM sibling of the selected code, with its EU27\nindicator matrix (single-code mode).",
            "properties": {
              "prodcom_code": {
                "description": "The sibling's PRODCOM code, in dotted form.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "label": {
                "description": "Its label, in the requested language when available.",
                "type": "string"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "Its measure × basis indicator matrix; empty when it has no EU27 data.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "prodcom_code",
              "label",
              "data"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SiblingComparison": {
            "additionalProperties": false,
            "description": "Single-code mode: the code's own indicator matrix, compared with its\nsame-level PRODCOM siblings (never the parent or sub-categories, so every\nseries is directly comparable).",
            "properties": {
              "mode": {
                "const": "single",
                "default": "single",
                "type": "string"
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How the customs code resolved to PRODCOM: the code picker, fallback and unit notes, the unavailability reason and the quantity-unit periods."
              },
              "aggregable": {
                "description": "Whether the resolved PRODCOM codes sit at one hierarchy level, so that data sums them; false forces an explicit pick.",
                "type": "boolean"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "The selected (or summed) codes' measure × basis indicator matrix; empty when unavailable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              },
              "siblings": {
                "description": "The same-level siblings, when a single PRODCOM code is in effect (an explicit pick or the sole mapping).",
                "items": {
                  "$ref": "#/$defs/ProdcomSibling"
                },
                "type": "array"
              },
              "siblings_truncated": {
                "description": "How many siblings were cut by the cap.",
                "type": "integer"
              }
            },
            "required": [
              "mode",
              "prodcom",
              "aggregable",
              "data",
              "siblings",
              "siblings_truncated"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_ExposureIndicator_": {
            "description": "The three EU27 trade-exposure indicators.",
            "enum": [
              "net_import_reliance",
              "trade_intensity",
              "export_propensity"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomUnavailability_": {
            "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable).",
            "enum": [
              "not_applicable",
              "no_mapping",
              "selection_required",
              "suppressed",
              "no_data"
            ],
            "type": "string"
          },
          "WireEnum_ProductionBasis_": {
            "description": "The production basis axis: total sold production and its two\n2021-onward components, own-account and sub-contracted.",
            "enum": [
              "total",
              "own",
              "sub"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ExposurePayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_trade_intensity",
      "description": "Trade Intensity (TI) = (Imports + Exports) / (Imports + Production),\nannual. Near 1 = highly trade-exposed sector; near 0 = predominantly\ndomestic. Used in the Commission's CEEAG methodology for carbon-leakage\n/ State-aid eligibility. Returns the TI series, its components,\nsibling-category/per-code comparisons, resolved PRODCOM codes and\navailability notes.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CodeHeader": {
            "additionalProperties": false,
            "description": "The customs-code block every analytical payload's ``header`` starts\nwith: what was queried and how the CN describes it.  The PRODCOM\nendpoints' whole header (their figures are annual EU/country production,\nwith no reporter or partner scope).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "ComponentStatusPayload": {
            "additionalProperties": false,
            "description": "One (measure, basis) trade-exposure result -- the wire mirror of\n``IndicatorComponentStatus``: the ratio line (``indicator``), the inputs\nit was built from (``components``) and the per-period status.  Empty (no\nperiods) when the indicator has no data.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "indicator": {
                "description": "The period-aligned indicator line; null = availability gap (see data_status).",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{input: period-aligned component series the indicator is built from}.",
                "type": "object"
              },
              "data_status": {
                "$ref": "#/$defs/DataStatusPayload",
                "description": "The per-period availability/gap/reliability verdicts and component statuses (empty arrays when the indicator has no data)."
              }
            },
            "required": [
              "periods",
              "indicator",
              "components",
              "data_status"
            ],
            "type": "object"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "EnteredCodeExposure": {
            "additionalProperties": false,
            "description": "One entered customs code of a multi-code comparison.",
            "properties": {
              "customs_code": {
                "description": "The entered customs code.",
                "type": "string"
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How it resolved to PRODCOM; unavailability_type is set when it has no usable EU27 data."
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "Its measure × basis indicator matrix; empty when unavailable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "customs_code",
              "prodcom",
              "data"
            ],
            "type": "object"
          },
          "EnteredCodesComparison": {
            "additionalProperties": false,
            "description": "Multi-code mode: the entered customs codes compared directly, plus\ntheir aggregate when it is a valid sum.",
            "properties": {
              "mode": {
                "const": "multi",
                "default": "multi",
                "type": "string"
              },
              "aggregable": {
                "description": "Whether the codes may be summed: every code has data and all their PRODCOM codes sit at one hierarchy level.",
                "type": "boolean"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "The aggregate's measure × basis indicator matrix; empty when not aggregable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              },
              "quantity_units": {
                "description": "The aggregate's quantity-unit periods.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              },
              "codes": {
                "description": "Every entered code, in request order.",
                "items": {
                  "$ref": "#/$defs/EnteredCodeExposure"
                },
                "type": "array"
              }
            },
            "required": [
              "mode",
              "aggregable",
              "data",
              "quantity_units",
              "codes"
            ],
            "type": "object"
          },
          "ExposurePayload": {
            "additionalProperties": false,
            "description": "POST /api/vulnerability/{net-import-reliance,trade-intensity,\nexport-propensity} — one shared shape; ``indicator`` says which.",
            "properties": {
              "header": {
                "$ref": "#/$defs/CodeHeader",
                "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
              },
              "indicator": {
                "$ref": "#/$defs/WireEnum_ExposureIndicator_",
                "description": "Which of the three EU27 trade-exposure indicators this payload carries."
              },
              "comparison": {
                "description": "The indicator figures: one code against its PRODCOM siblings ('single'), or the entered codes side by side ('multi').",
                "discriminator": {
                  "mapping": {
                    "multi": "#/$defs/EnteredCodesComparison",
                    "single": "#/$defs/SiblingComparison"
                  },
                  "propertyName": "mode"
                },
                "oneOf": [
                  {
                    "$ref": "#/$defs/SiblingComparison"
                  },
                  {
                    "$ref": "#/$defs/EnteredCodesComparison"
                  }
                ]
              }
            },
            "required": [
              "header",
              "indicator",
              "comparison"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProdcomMetaPayload": {
            "additionalProperties": false,
            "description": "How a customs code resolved to PRODCOM, carried by every DS-059358\npayload: the resolved-code picker, fallback notes, the unavailability\nreason and the quantity-unit periods.  ``unavailability_type`` comes\nfrom the resolve ('not_applicable' / 'no_mapping' / 'selection_required'),\nselect ('suppressed') or fetch ('no_data') stage -- see ProdcomOps.",
            "properties": {
              "prodcom_codes": {
                "description": "The resolved PRODCOM code picker (deduplicated, data-bearing mappings); empty in multi-code mode, where each comparison entry carries its own.",
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              },
              "notes": {
                "description": "Fallback, selection and quantity-unit notes explaining the resolution.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "unavailability_type": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ProdcomUnavailability_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why no PRODCOM query can be formed or served, when it can't."
              },
              "quantity_units": {
                "description": "The unit of the quantity totals and unit values, period by period, the same on every route. Figures in spans with different units are not comparable. A production-only payload lists production units; a trade-exposure payload lists trade units too.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "prodcom_codes",
              "notes",
              "unavailability_type",
              "quantity_units"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "ProdcomSibling": {
            "additionalProperties": false,
            "description": "One same-level PRODCOM sibling of the selected code, with its EU27\nindicator matrix (single-code mode).",
            "properties": {
              "prodcom_code": {
                "description": "The sibling's PRODCOM code, in dotted form.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "label": {
                "description": "Its label, in the requested language when available.",
                "type": "string"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "Its measure × basis indicator matrix; empty when it has no EU27 data.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "prodcom_code",
              "label",
              "data"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SiblingComparison": {
            "additionalProperties": false,
            "description": "Single-code mode: the code's own indicator matrix, compared with its\nsame-level PRODCOM siblings (never the parent or sub-categories, so every\nseries is directly comparable).",
            "properties": {
              "mode": {
                "const": "single",
                "default": "single",
                "type": "string"
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How the customs code resolved to PRODCOM: the code picker, fallback and unit notes, the unavailability reason and the quantity-unit periods."
              },
              "aggregable": {
                "description": "Whether the resolved PRODCOM codes sit at one hierarchy level, so that data sums them; false forces an explicit pick.",
                "type": "boolean"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "The selected (or summed) codes' measure × basis indicator matrix; empty when unavailable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              },
              "siblings": {
                "description": "The same-level siblings, when a single PRODCOM code is in effect (an explicit pick or the sole mapping).",
                "items": {
                  "$ref": "#/$defs/ProdcomSibling"
                },
                "type": "array"
              },
              "siblings_truncated": {
                "description": "How many siblings were cut by the cap.",
                "type": "integer"
              }
            },
            "required": [
              "mode",
              "prodcom",
              "aggregable",
              "data",
              "siblings",
              "siblings_truncated"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_ExposureIndicator_": {
            "description": "The three EU27 trade-exposure indicators.",
            "enum": [
              "net_import_reliance",
              "trade_intensity",
              "export_propensity"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomUnavailability_": {
            "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable).",
            "enum": [
              "not_applicable",
              "no_mapping",
              "selection_required",
              "suppressed",
              "no_data"
            ],
            "type": "string"
          },
          "WireEnum_ProductionBasis_": {
            "description": "The production basis axis: total sold production and its two\n2021-onward components, own-account and sub-contracted.",
            "enum": [
              "total",
              "own",
              "sub"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ExposurePayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_export_propensity",
      "description": "Export Propensity = Exports / Production, annual: the share of EU\nproduction that is exported. Not clamped -- values above 100% are\nlegitimate (re-exports, stock drawdown, scope differences). Returns the\nexport-propensity matrix, a sibling/per-code comparison, resolved\nPRODCOM codes and availability notes.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CodeHeader": {
            "additionalProperties": false,
            "description": "The customs-code block every analytical payload's ``header`` starts\nwith: what was queried and how the CN describes it.  The PRODCOM\nendpoints' whole header (their figures are annual EU/country production,\nwith no reporter or partner scope).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "ComponentStatusPayload": {
            "additionalProperties": false,
            "description": "One (measure, basis) trade-exposure result -- the wire mirror of\n``IndicatorComponentStatus``: the ratio line (``indicator``), the inputs\nit was built from (``components``) and the per-period status.  Empty (no\nperiods) when the indicator has no data.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "indicator": {
                "description": "The period-aligned indicator line; null = availability gap (see data_status).",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{input: period-aligned component series the indicator is built from}.",
                "type": "object"
              },
              "data_status": {
                "$ref": "#/$defs/DataStatusPayload",
                "description": "The per-period availability/gap/reliability verdicts and component statuses (empty arrays when the indicator has no data)."
              }
            },
            "required": [
              "periods",
              "indicator",
              "components",
              "data_status"
            ],
            "type": "object"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "EnteredCodeExposure": {
            "additionalProperties": false,
            "description": "One entered customs code of a multi-code comparison.",
            "properties": {
              "customs_code": {
                "description": "The entered customs code.",
                "type": "string"
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How it resolved to PRODCOM; unavailability_type is set when it has no usable EU27 data."
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "Its measure × basis indicator matrix; empty when unavailable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "customs_code",
              "prodcom",
              "data"
            ],
            "type": "object"
          },
          "EnteredCodesComparison": {
            "additionalProperties": false,
            "description": "Multi-code mode: the entered customs codes compared directly, plus\ntheir aggregate when it is a valid sum.",
            "properties": {
              "mode": {
                "const": "multi",
                "default": "multi",
                "type": "string"
              },
              "aggregable": {
                "description": "Whether the codes may be summed: every code has data and all their PRODCOM codes sit at one hierarchy level.",
                "type": "boolean"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "The aggregate's measure × basis indicator matrix; empty when not aggregable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              },
              "quantity_units": {
                "description": "The aggregate's quantity-unit periods.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              },
              "codes": {
                "description": "Every entered code, in request order.",
                "items": {
                  "$ref": "#/$defs/EnteredCodeExposure"
                },
                "type": "array"
              }
            },
            "required": [
              "mode",
              "aggregable",
              "data",
              "quantity_units",
              "codes"
            ],
            "type": "object"
          },
          "ExposurePayload": {
            "additionalProperties": false,
            "description": "POST /api/vulnerability/{net-import-reliance,trade-intensity,\nexport-propensity} — one shared shape; ``indicator`` says which.",
            "properties": {
              "header": {
                "$ref": "#/$defs/CodeHeader",
                "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
              },
              "indicator": {
                "$ref": "#/$defs/WireEnum_ExposureIndicator_",
                "description": "Which of the three EU27 trade-exposure indicators this payload carries."
              },
              "comparison": {
                "description": "The indicator figures: one code against its PRODCOM siblings ('single'), or the entered codes side by side ('multi').",
                "discriminator": {
                  "mapping": {
                    "multi": "#/$defs/EnteredCodesComparison",
                    "single": "#/$defs/SiblingComparison"
                  },
                  "propertyName": "mode"
                },
                "oneOf": [
                  {
                    "$ref": "#/$defs/SiblingComparison"
                  },
                  {
                    "$ref": "#/$defs/EnteredCodesComparison"
                  }
                ]
              }
            },
            "required": [
              "header",
              "indicator",
              "comparison"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProdcomMetaPayload": {
            "additionalProperties": false,
            "description": "How a customs code resolved to PRODCOM, carried by every DS-059358\npayload: the resolved-code picker, fallback notes, the unavailability\nreason and the quantity-unit periods.  ``unavailability_type`` comes\nfrom the resolve ('not_applicable' / 'no_mapping' / 'selection_required'),\nselect ('suppressed') or fetch ('no_data') stage -- see ProdcomOps.",
            "properties": {
              "prodcom_codes": {
                "description": "The resolved PRODCOM code picker (deduplicated, data-bearing mappings); empty in multi-code mode, where each comparison entry carries its own.",
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              },
              "notes": {
                "description": "Fallback, selection and quantity-unit notes explaining the resolution.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "unavailability_type": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ProdcomUnavailability_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why no PRODCOM query can be formed or served, when it can't."
              },
              "quantity_units": {
                "description": "The unit of the quantity totals and unit values, period by period, the same on every route. Figures in spans with different units are not comparable. A production-only payload lists production units; a trade-exposure payload lists trade units too.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "prodcom_codes",
              "notes",
              "unavailability_type",
              "quantity_units"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "ProdcomSibling": {
            "additionalProperties": false,
            "description": "One same-level PRODCOM sibling of the selected code, with its EU27\nindicator matrix (single-code mode).",
            "properties": {
              "prodcom_code": {
                "description": "The sibling's PRODCOM code, in dotted form.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "label": {
                "description": "Its label, in the requested language when available.",
                "type": "string"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "Its measure × basis indicator matrix; empty when it has no EU27 data.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "prodcom_code",
              "label",
              "data"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SiblingComparison": {
            "additionalProperties": false,
            "description": "Single-code mode: the code's own indicator matrix, compared with its\nsame-level PRODCOM siblings (never the parent or sub-categories, so every\nseries is directly comparable).",
            "properties": {
              "mode": {
                "const": "single",
                "default": "single",
                "type": "string"
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How the customs code resolved to PRODCOM: the code picker, fallback and unit notes, the unavailability reason and the quantity-unit periods."
              },
              "aggregable": {
                "description": "Whether the resolved PRODCOM codes sit at one hierarchy level, so that data sums them; false forces an explicit pick.",
                "type": "boolean"
              },
              "data": {
                "additionalProperties": {
                  "additionalProperties": {
                    "$ref": "#/$defs/ComponentStatusPayload"
                  },
                  "propertyNames": {
                    "$ref": "#/$defs/WireEnum_ProductionBasis_"
                  },
                  "type": "object"
                },
                "description": "The selected (or summed) codes' measure × basis indicator matrix; empty when unavailable.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              },
              "siblings": {
                "description": "The same-level siblings, when a single PRODCOM code is in effect (an explicit pick or the sole mapping).",
                "items": {
                  "$ref": "#/$defs/ProdcomSibling"
                },
                "type": "array"
              },
              "siblings_truncated": {
                "description": "How many siblings were cut by the cap.",
                "type": "integer"
              }
            },
            "required": [
              "mode",
              "prodcom",
              "aggregable",
              "data",
              "siblings",
              "siblings_truncated"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_ExposureIndicator_": {
            "description": "The three EU27 trade-exposure indicators.",
            "enum": [
              "net_import_reliance",
              "trade_intensity",
              "export_propensity"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomUnavailability_": {
            "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable).",
            "enum": [
              "not_applicable",
              "no_mapping",
              "selection_required",
              "suppressed",
              "no_data"
            ],
            "type": "string"
          },
          "WireEnum_ProductionBasis_": {
            "description": "The production basis axis: total sold production and its two\n2021-onward components, own-account and sub-contracted.",
            "enum": [
              "total",
              "own",
              "sub"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/ExposurePayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_subcontracting",
      "description": "EU27 sub-contracting intensity: the share of sold production that is\ntoll (sub-contracted) manufacturing rather than own-account output.\nReturns intensity (%) across value/quantity, its component series,\nper-period data-quality status, resolved PRODCOM codes and availability\nnotes. The own/sub split only exists from 2021 onward. Accepts exactly\none customs code; multi-code selections are rejected.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CodeHeader": {
            "additionalProperties": false,
            "description": "The customs-code block every analytical payload's ``header`` starts\nwith: what was queried and how the CN describes it.  The PRODCOM\nendpoints' whole header (their figures are annual EU/country production,\nwith no reporter or partner scope).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "ComponentStatusPayload": {
            "additionalProperties": false,
            "description": "One (measure, basis) trade-exposure result -- the wire mirror of\n``IndicatorComponentStatus``: the ratio line (``indicator``), the inputs\nit was built from (``components``) and the per-period status.  Empty (no\nperiods) when the indicator has no data.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "indicator": {
                "description": "The period-aligned indicator line; null = availability gap (see data_status).",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{input: period-aligned component series the indicator is built from}.",
                "type": "object"
              },
              "data_status": {
                "$ref": "#/$defs/DataStatusPayload",
                "description": "The per-period availability/gap/reliability verdicts and component statuses (empty arrays when the indicator has no data)."
              }
            },
            "required": [
              "periods",
              "indicator",
              "components",
              "data_status"
            ],
            "type": "object"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "JsonValue": {},
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProdcomMetaPayload": {
            "additionalProperties": false,
            "description": "How a customs code resolved to PRODCOM, carried by every DS-059358\npayload: the resolved-code picker, fallback notes, the unavailability\nreason and the quantity-unit periods.  ``unavailability_type`` comes\nfrom the resolve ('not_applicable' / 'no_mapping' / 'selection_required'),\nselect ('suppressed') or fetch ('no_data') stage -- see ProdcomOps.",
            "properties": {
              "prodcom_codes": {
                "description": "The resolved PRODCOM code picker (deduplicated, data-bearing mappings); empty in multi-code mode, where each comparison entry carries its own.",
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              },
              "notes": {
                "description": "Fallback, selection and quantity-unit notes explaining the resolution.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "unavailability_type": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ProdcomUnavailability_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why no PRODCOM query can be formed or served, when it can't."
              },
              "quantity_units": {
                "description": "The unit of the quantity totals and unit values, period by period, the same on every route. Figures in spans with different units are not comparable. A production-only payload lists production units; a trade-exposure payload lists trade units too.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "prodcom_codes",
              "notes",
              "unavailability_type",
              "quantity_units"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SubcontractingIntensityPayload": {
            "additionalProperties": false,
            "description": "POST /api/autonomy/subcontracting.",
            "properties": {
              "header": {
                "$ref": "#/$defs/CodeHeader",
                "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How the customs code resolved to PRODCOM: the code picker, fallback and unit notes, the unavailability reason and the quantity-unit periods."
              },
              "intensity": {
                "additionalProperties": {
                  "$ref": "#/$defs/ComponentStatusPayload"
                },
                "description": "{measure: the EU27 sub-contracting intensity line and its components}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "header",
              "prodcom",
              "intensity"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomUnavailability_": {
            "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable).",
            "enum": [
              "not_applicable",
              "no_mapping",
              "selection_required",
              "suppressed",
              "no_data"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/SubcontractingIntensityPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_subcontracting_reporters",
      "description": "Per-country sub-contracting intensity (PRODCOM): for each reporting\ncountry, the share of its sold production that is toll manufacturing --\nwhich countries act as processing hubs vs. autonomous producers. Spans\nall DS-059358 reporters that report the own/sub split; others simply\ndon't appear. Country cells are heavily confidentiality-suppressed\n(null, not zero, when absent). Accepts exactly one customs code;\nmulti-code selections are rejected.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          },
          "compact": {
            "default": false,
            "description": "If true, condense long numeric time series (more than ~6 points -- typically monthly/quarterly windows or wide multi-partner/multi-period breakdowns) into summary statistics (first, last, min, max, mean, pct_change) instead of returning every data point. Leave false for full-fidelity series (e.g. to actually plot a chart); set true when you just need the headline trend and want to save context.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CodeHeader": {
            "additionalProperties": false,
            "description": "The customs-code block every analytical payload's ``header`` starts\nwith: what was queried and how the CN describes it.  The PRODCOM\nendpoints' whole header (their figures are annual EU/country production,\nwith no reporter or partner scope).",
            "properties": {
              "customs_code": {
                "description": "The queried customs code(s), as requested (several codes joined).",
                "type": "string"
              },
              "levels": {
                "description": "The customs code's CN description hierarchy, chapter first.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "customs_code_label": {
                "description": "The customs code's display label.",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_",
                "description": "The period grain of every series in the payload ('year' for PRODCOM)."
              }
            },
            "required": [
              "customs_code",
              "levels",
              "customs_code_label",
              "frequency"
            ],
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "GeoIntensityBlock": {
            "additionalProperties": false,
            "description": "A per-reporter intensity panel plus its GISCO-keyed choropleth map.",
            "properties": {
              "indicator": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{country name: period-aligned intensity}; null = suppressed or not reported.",
                "type": "object"
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{country name: period-aligned sub-contracted production behind the intensity}.",
                "type": "object"
              },
              "data_status": {
                "additionalProperties": {
                  "$ref": "#/$defs/DataStatusPayload"
                },
                "description": "{country name: its per-period status}.",
                "type": "object"
              },
              "intensity_map": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "{GISCO code: latest-year intensity} (choropleth view).",
                "type": "object"
              }
            },
            "required": [
              "indicator",
              "components",
              "data_status",
              "intensity_map"
            ],
            "type": "object"
          },
          "JsonValue": {},
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProdcomMetaPayload": {
            "additionalProperties": false,
            "description": "How a customs code resolved to PRODCOM, carried by every DS-059358\npayload: the resolved-code picker, fallback notes, the unavailability\nreason and the quantity-unit periods.  ``unavailability_type`` comes\nfrom the resolve ('not_applicable' / 'no_mapping' / 'selection_required'),\nselect ('suppressed') or fetch ('no_data') stage -- see ProdcomOps.",
            "properties": {
              "prodcom_codes": {
                "description": "The resolved PRODCOM code picker (deduplicated, data-bearing mappings); empty in multi-code mode, where each comparison entry carries its own.",
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              },
              "notes": {
                "description": "Fallback, selection and quantity-unit notes explaining the resolution.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "unavailability_type": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ProdcomUnavailability_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why no PRODCOM query can be formed or served, when it can't."
              },
              "quantity_units": {
                "description": "The unit of the quantity totals and unit values, period by period, the same on every route. Figures in spans with different units are not comparable. A production-only payload lists production units; a trade-exposure payload lists trade units too.",
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "prodcom_codes",
              "notes",
              "unavailability_type",
              "quantity_units"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SubcontractingReporters": {
            "additionalProperties": false,
            "description": "The per-reporter sub-contracting intensity, per measure, on one\nannual axis.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "data": {
                "additionalProperties": {
                  "$ref": "#/$defs/GeoIntensityBlock"
                },
                "description": "{measure: the per-reporter intensity panel and map}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_Measure_"
                },
                "type": "object"
              }
            },
            "required": [
              "periods",
              "data"
            ],
            "type": "object"
          },
          "SubcontractingReportersPayload": {
            "additionalProperties": false,
            "description": "POST /api/autonomy/subcontracting-reporters.",
            "properties": {
              "header": {
                "$ref": "#/$defs/CodeHeader",
                "description": "The queried customs code, its CN levels and label, and the frequency (always 'year')."
              },
              "prodcom": {
                "$ref": "#/$defs/ProdcomMetaPayload",
                "description": "How the customs code resolved to PRODCOM: the code picker, fallback and unit notes, the unavailability reason and the quantity-unit periods."
              },
              "intensity": {
                "$ref": "#/$defs/SubcontractingReporters",
                "description": "The per-reporter sub-contracting intensity, per measure."
              }
            },
            "required": [
              "header",
              "prodcom",
              "intensity"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomUnavailability_": {
            "description": "Why no PRODCOM query can be formed for a customs code (``None`` when\nthe mapping is usable).",
            "enum": [
              "not_applicable",
              "no_mapping",
              "selection_required",
              "suppressed",
              "no_data"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/SubcontractingReportersPayload"
              },
              {
                "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "resolve_product_code",
      "description": "Resolve a free-text query or CN code(s) into validated customs\ncode(s) with descriptions -- the recommended first step before using\na code as `customs_code` in any other tool's `query`. Saves the search ->\nvalidate -> (optional) subtree round-trip: a bare keyword runs a search,\na single code (or comma-separated list) is validated and described\ndirectly.\n\nTip: Comext/CN nomenclature is frequently coarser than a colloquial\nproduct name (e.g. there is no code for \"glass jars\" alone -- only\nheading 7010, which bundles jars with bottles, flasks and closures).\nCheck `has_subcodes` and, if useful, set `include_children=true` to see\nwhether a finer sub-code is actually a better match before committing to\none code for a whole report.\n\nReturns `{mode, query, data}`: `data` is the typed validation or search\nresponse. A single-code validation also carries `subtree` when requested.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "additionalProperties": false,
        "properties": {
          "query": {
            "description": "Free-text keyword (e.g. 'glass jars') OR one or more CN codes, comma-separated (e.g. '7010' or '7010, 7013'), OR a single residual customs code (850440XX, 85SSS999, 85SSS).",
            "type": "string"
          },
          "lang": {
            "default": "en",
            "description": "Language for translated labels in the response; any other language is refused.",
            "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"
          },
          "limit": {
            "default": 20,
            "description": "Max keyword-search results (ignored for direct code validation).",
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          },
          "include_children": {
            "default": false,
            "description": "When resolving a single direct code, also fetch its immediate CN subtree so finer-grained alternatives are visible in one call.",
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "MatchedProdcom": {
            "additionalProperties": false,
            "description": "The PRODCOM code resolved from a dotted search query.",
            "properties": {
              "prodcom_code": {
                "description": "The resolved PRODCOM code, in dotted form.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The code's label, when the nomenclature lists one."
              }
            },
            "required": [
              "prodcom_code",
              "description"
            ],
            "type": "object"
          },
          "RecordedLinkPayload": {
            "additionalProperties": false,
            "description": "One recorded predecessor/successor edge of an exact segment.",
            "properties": {
              "customs_code": {
                "description": "The other segment's customs code.",
                "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."
              },
              "marker": {
                "description": "Eurostat's relation marker, as recorded.",
                "type": "string"
              },
              "match": {
                "$ref": "#/$defs/WireEnum_LinkMatch_",
                "description": "'matched' when the endpoint resolves to a recorded segment by its full window, 'unmatched' otherwise (never attached to a guessed segment)."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "marker",
              "match"
            ],
            "type": "object"
          },
          "RecordedLinksPayload": {
            "additionalProperties": false,
            "properties": {
              "successors": {
                "description": "Edges recorded from this segment.",
                "items": {
                  "$ref": "#/$defs/RecordedLinkPayload"
                },
                "type": "array"
              },
              "predecessors": {
                "description": "Edges recorded into this segment.",
                "items": {
                  "$ref": "#/$defs/RecordedLinkPayload"
                },
                "type": "array"
              }
            },
            "required": [
              "successors",
              "predecessors"
            ],
            "type": "object"
          },
          "ResolveProductCodeResponse": {
            "discriminator": {
              "mapping": {
                "search": "#/$defs/SearchResolution",
                "validate": "#/$defs/ValidateResolution"
              },
              "propertyName": "mode"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/ValidateResolution"
              },
              {
                "$ref": "#/$defs/SearchResolution"
              }
            ]
          },
          "SearchResolution": {
            "additionalProperties": false,
            "description": "A nomenclature search response and the caller's original query.",
            "properties": {
              "mode": {
                "const": "search",
                "default": "search",
                "type": "string"
              },
              "query": {
                "type": "string"
              },
              "data": {
                "$ref": "#/$defs/SearchResponse"
              }
            },
            "required": [
              "mode",
              "query",
              "data"
            ],
            "type": "object"
          },
          "SearchResponse": {
            "additionalProperties": false,
            "description": "GET /api/reference/search — ranked candidates; ``matched_prodcom`` is\nset when the query was a dotted PRODCOM notation.",
            "properties": {
              "query": {
                "description": "The query as received.",
                "type": "string"
              },
              "lang": {
                "description": "The label language used.",
                "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"
              },
              "source": {
                "$ref": "#/$defs/WireEnum_SearchSource_",
                "description": "The nomenclature searched ('cn', or 'prodcom' for PRODCOM-notation queries)."
              },
              "matched_prodcom": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/MatchedProdcom"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The resolved PRODCOM code descriptor, when the query used PRODCOM notation (present even when no CN code maps)."
              },
              "results": {
                "description": "The ranked candidates.",
                "items": {
                  "$ref": "#/$defs/SearchResult"
                },
                "type": "array"
              }
            },
            "required": [
              "query",
              "lang",
              "source",
              "matched_prodcom",
              "results"
            ],
            "type": "object"
          },
          "SearchResult": {
            "additionalProperties": false,
            "description": "One ranked search candidate.",
            "properties": {
              "code": {
                "description": "The candidate's customs code.",
                "type": "string"
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The code's label, in the requested language; null for a mapped code the nomenclature does not list."
              },
              "path": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The candidate's breadcrumb: its ancestor labels joined into one string; null alongside a null label."
              },
              "via_prodcom": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The dotted PRODCOM form the match came through, for PRODCOM-notation queries."
              }
            },
            "required": [
              "code",
              "label",
              "path",
              "via_prodcom"
            ],
            "type": "object"
          },
          "SegmentHistoryEntry": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              },
              "recorded_links": {
                "$ref": "#/$defs/RecordedLinksPayload",
                "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)."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang",
              "recorded_links"
            ],
            "type": "object"
          },
          "SegmentHistoryPayload": {
            "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": {
                  "$ref": "#/$defs/SegmentHistoryEntry"
                },
                "type": "array"
              }
            },
            "required": [
              "customs_code",
              "metadata_generation",
              "segments"
            ],
            "type": "object"
          },
          "SegmentPayload": {
            "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"
              },
              "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."
              },
              "kind": {
                "$ref": "#/$defs/WireEnum_SegmentKind_",
                "description": "The classification row's kind ('cn', 'residual_xx', 'letter_coded')."
              },
              "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."
              }
            },
            "required": [
              "customs_code",
              "valid_from",
              "valid_to",
              "kind",
              "label",
              "label_lang"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SubcodeRow": {
            "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"
              },
              "label": {
                "description": "The label of the row's (latest) definition, in the requested language when recorded.",
                "type": "string"
              },
              "untranslated": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True when the label fell back to English."
              },
              "segments": {
                "description": "The definitions in force during the basket's window (empty for residual rows and for validation rows).",
                "items": {
                  "$ref": "#/$defs/SegmentPayload"
                },
                "type": "array"
              },
              "residual_kind": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualKind_"
                  },
                  {
                    "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_spelling": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualSpelling_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a residual row: 'xx', 'letter' or 'reason_group'."
              },
              "residual_reason": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualReason_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a letter code or reason group: the reason letter (S, Y, E, I, …)."
              },
              "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)."
              }
            },
            "required": [
              "basket_key",
              "customs_code",
              "label",
              "segments"
            ],
            "type": "object"
          },
          "SubtreeNode": {
            "additionalProperties": false,
            "description": "One node of a CN sub-tree (recursive). The optional flags are sparse\non the wire: present when true (``siblings``: for catch-all nodes),\nabsent otherwise.",
            "properties": {
              "customs_code": {
                "description": "The node's customs code.",
                "type": "string"
              },
              "text": {
                "description": "The code's label, in the requested language.",
                "type": "string"
              },
              "children": {
                "description": "The code's sub-codes.",
                "items": {
                  "$ref": "#/$defs/SubtreeNode"
                },
                "type": "array"
              },
              "untranslated": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True when the label fell back to English."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') node."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all ('other') node, the ordinary siblings it excludes."
              }
            },
            "required": [
              "customs_code",
              "text",
              "children"
            ],
            "type": "object"
          },
          "ValidateCustomsCodeBatchResponse": {
            "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": [
                    {
                      "$ref": "#/$defs/ValidateCustomsCodeResponse"
                    },
                    {
                      "$ref": "#/$defs/ValidateCustomsCodeError"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "results"
            ],
            "type": "object"
          },
          "ValidateCustomsCodeError": {
            "additionalProperties": false,
            "description": "One batch item's failure shape.",
            "properties": {
              "customs_code": {
                "description": "The input item as typed.",
                "type": "string"
              },
              "error": {
                "$ref": "#/$defs/ValidateCustomsCodeErrorDetail",
                "description": "Why it failed."
              }
            },
            "required": [
              "customs_code",
              "error"
            ],
            "type": "object"
          },
          "ValidateCustomsCodeErrorDetail": {
            "additionalProperties": false,
            "properties": {
              "status": {
                "description": "The HTTP status the single-code endpoint would have returned.",
                "type": "integer"
              },
              "detail": {
                "description": "The error message.",
                "type": "string"
              }
            },
            "required": [
              "status",
              "detail"
            ],
            "type": "object"
          },
          "ValidateCustomsCodeResponse": {
            "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"
              },
              "levels": {
                "description": "The code's CN description hierarchy (one entry per ancestor level), in the requested language.",
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "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"
              },
              "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)."
              },
              "residual_kind": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualKind_"
                  },
                  {
                    "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_spelling": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualSpelling_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The residual spelling's exact shape: 'xx', 'letter' or 'reason_group'."
              },
              "residual_reason": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/WireEnum_ResidualReason_"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The reason letter of a letter code or reason group (S, Y, E, I, …)."
              },
              "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)."
              },
              "residual_customs_codes": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/SubcodeRow"
                    },
                    "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."
              },
              "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)."
              },
              "segment_history": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/SegmentHistoryPayload"
                    },
                    "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"
          },
          "ValidateResolution": {
            "additionalProperties": false,
            "description": "A validated single/batch code response, optionally with its subtree.",
            "properties": {
              "mode": {
                "const": "validate",
                "default": "validate",
                "type": "string"
              },
              "query": {
                "type": "string"
              },
              "data": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ValidateCustomsCodeResponse"
                  },
                  {
                    "$ref": "#/$defs/ValidateCustomsCodeBatchResponse"
                  }
                ]
              },
              "subtree": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SubtreeNode"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "mode",
              "query",
              "data"
            ],
            "type": "object"
          },
          "WireEnum_LinkMatch_": {
            "enum": [
              "matched",
              "unmatched"
            ],
            "type": "string"
          },
          "WireEnum_ResidualKind_": {
            "enum": [
              "xx",
              "letter"
            ],
            "type": "string"
          },
          "WireEnum_ResidualReason_": {
            "enum": [
              "A",
              "B",
              "C",
              "E",
              "F",
              "I",
              "M",
              "P",
              "R",
              "S",
              "T",
              "V",
              "W",
              "Y"
            ],
            "type": "string"
          },
          "WireEnum_ResidualSpelling_": {
            "enum": [
              "xx",
              "letter",
              "reason_group"
            ],
            "type": "string"
          },
          "WireEnum_SearchSource_": {
            "description": "The nomenclature a search ran over: the CN index, or the PRODCOM\nreverse mapping a dotted-notation query is answered from.",
            "enum": [
              "cn",
              "prodcom"
            ],
            "type": "string"
          },
          "WireEnum_SegmentKind_": {
            "description": "The ingest classification of one CN.txt identity.",
            "enum": [
              "cn",
              "residual_xx",
              "letter_coded",
              "chapter_00",
              "other"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "$ref": "#/$defs/ResolveProductCodeResponse"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_customs_code_profile",
      "description": "Report-section helper (\"Scope & definitions\"): the resolved customs\ncode + label (in `query.lang`), a one-sentence caveat when the code\nbundles several sub-codes (`has_subcodes`), the data-coverage window\nactually cached for it, and whether it has a usable PRODCOM mapping\n(gating the autonomy/vulnerability section). Deliberately thin -- no\nfull CN hierarchy breadcrumb or sibling enumeration.\n\nReturns `{\"result\": {narrative_facts, chart_data, links, available,\nreason}}` -- see `get_market_summary` for the section shape this convention\nfollows across all of this bridge's report-section helpers.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "BundlingWithProdcom": {
            "additionalProperties": false,
            "properties": {
              "prodcom_mapping": {
                "$ref": "#/$defs/ProdcomMapping"
              },
              "is_bundling_heading": {
                "const": true,
                "type": "boolean"
              },
              "bundled_children": {
                "items": {
                  "$ref": "#/$defs/CodeLabel_CustomsCode_"
                },
                "type": "array"
              },
              "customs_code": {
                "type": "string"
              },
              "resolved_code": {
                "type": "string"
              },
              "resolved_label": {
                "type": "string"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "data_coverage": {
                "$ref": "#/$defs/CoverageWindow"
              },
              "code_valid_from": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "prodcom_mapping",
              "is_bundling_heading",
              "bundled_children",
              "customs_code",
              "resolved_code",
              "resolved_label",
              "levels",
              "data_coverage",
              "code_valid_from"
            ],
            "type": "object"
          },
          "BundlingWithoutProdcom": {
            "additionalProperties": false,
            "properties": {
              "is_bundling_heading": {
                "const": true,
                "type": "boolean"
              },
              "bundled_children": {
                "items": {
                  "$ref": "#/$defs/CodeLabel_CustomsCode_"
                },
                "type": "array"
              },
              "customs_code": {
                "type": "string"
              },
              "resolved_code": {
                "type": "string"
              },
              "resolved_label": {
                "type": "string"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "data_coverage": {
                "$ref": "#/$defs/CoverageWindow"
              },
              "code_valid_from": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "is_bundling_heading",
              "bundled_children",
              "customs_code",
              "resolved_code",
              "resolved_label",
              "levels",
              "data_coverage",
              "code_valid_from"
            ],
            "type": "object"
          },
          "Closed": {
            "additionalProperties": false,
            "description": "An object that must be empty: the bridge sends ``{}`` for it.",
            "properties": {},
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "CoverageWindow": {
            "additionalProperties": false,
            "properties": {
              "data_min": {
                "description": "The first month with data inside the window ('YYYY-MM').",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "data_max": {
                "description": "The last month with data inside the window ('YYYY-MM').",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              }
            },
            "required": [
              "data_min",
              "data_max"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "ProdcomMapping": {
            "additionalProperties": false,
            "description": "The PRODCOM mapping, present for the codes PRODCOM covers.",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "reason": {
                "type": "null"
              },
              "prodcom_codes": {
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              }
            },
            "required": [
              "available",
              "reason",
              "prodcom_codes"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "ProfileLinks": {
            "additionalProperties": false,
            "properties": {
              "resolved_label": {
                "type": "string"
              }
            },
            "required": [
              "resolved_label"
            ],
            "type": "object"
          },
          "Section_BundlingWithProdcom_Closed_ProfileLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/BundlingWithProdcom"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/ProfileLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_BundlingWithoutProdcom_Closed_ProfileLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/BundlingWithoutProdcom"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/ProfileLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_SingleWithProdcom_Closed_ProfileLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/SingleWithProdcom"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/ProfileLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_SingleWithoutProdcom_Closed_ProfileLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/SingleWithoutProdcom"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/ProfileLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "SingleWithProdcom": {
            "additionalProperties": false,
            "properties": {
              "prodcom_mapping": {
                "$ref": "#/$defs/ProdcomMapping"
              },
              "is_bundling_heading": {
                "const": false,
                "type": "boolean"
              },
              "customs_code": {
                "type": "string"
              },
              "resolved_code": {
                "type": "string"
              },
              "resolved_label": {
                "type": "string"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "data_coverage": {
                "$ref": "#/$defs/CoverageWindow"
              },
              "code_valid_from": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "prodcom_mapping",
              "is_bundling_heading",
              "customs_code",
              "resolved_code",
              "resolved_label",
              "levels",
              "data_coverage",
              "code_valid_from"
            ],
            "type": "object"
          },
          "SingleWithoutProdcom": {
            "additionalProperties": false,
            "properties": {
              "is_bundling_heading": {
                "const": false,
                "type": "boolean"
              },
              "customs_code": {
                "type": "string"
              },
              "resolved_code": {
                "type": "string"
              },
              "resolved_label": {
                "type": "string"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "data_coverage": {
                "$ref": "#/$defs/CoverageWindow"
              },
              "code_valid_from": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "is_bundling_heading",
              "customs_code",
              "resolved_code",
              "resolved_label",
              "levels",
              "data_coverage",
              "code_valid_from"
            ],
            "type": "object"
          },
          "UnavailableSection": {
            "additionalProperties": false,
            "description": "A section whose upstream sources failed: the reason, empty slots\nelsewhere (the envelope keys stay stable for MCP consumers).",
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/Closed"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/Closed"
              },
              "available": {
                "const": false,
                "default": false,
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/Section_BundlingWithProdcom_Closed_ProfileLinks_"
              },
              {
                "$ref": "#/$defs/Section_BundlingWithoutProdcom_Closed_ProfileLinks_"
              },
              {
                "$ref": "#/$defs/Section_SingleWithProdcom_Closed_ProfileLinks_"
              },
              {
                "$ref": "#/$defs/Section_SingleWithoutProdcom_Closed_ProfileLinks_"
              },
              {
                "$ref": "#/$defs/UnavailableSection"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_market_summary",
      "description": "Report-section helper (\"General overview\"): condensed, report-ready\ndigest of how a market has evolved over the chosen window -- one call\ninstead of separately fetching and cross-referencing get_overview +\nget_reporter_detail + get_concentration + get_net_import_reliance\nyourself. Set `query.frequency = \"year\"` for a multi-year evolution\nsummary (recommended over the model's default of \"quarter\").\n\nEvery figure reflects `query` exactly as given -- the same\ncustoms-code/reporter/partner_set/period slice a dashboard user would\nhave selected. Nothing here substitutes a different reporter or partner_set\n(e.g. to contrast intra-EU against extra-EU trade): call this again\nwith a different `query.partner_set` for that, the same way a dashboard\nuser would switch the sidebar's selector.\n\nReturns `{\"result\": {narrative_facts, chart_data, links, available,\nreason}}`. `narrative_facts` combines, for the flow selected by\n`query.partner_set`:\n- Headline trade: first/last/min/max/pct_change for export & import\n  value, quantity and price, plus the trade-balance trend.\n- Partner concentration: first/last/pct_change of the value-based HHI\n  for imports and exports.\n- Top partners *and* top EU reporters by value: each one's\n  first/last/pct_change -- i.e. who is gaining or losing share.\n- Net import reliance: first/last/pct_change of the annual NIR % for\n  `query`'s own `reporter`/`partner_set` (only `frequency` is normalised\n  to \"year\", since NIR is structurally annual and the upstream API\n  always returns it that way regardless); omitted if the customs code\n  has no PRODCOM mapping.\n`chart_data` carries the full-fidelity headline trade and top-partner/\ntop-reporter series for charting.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "AnnualSummaryStats": {
            "additionalProperties": false,
            "description": "An annual series summary whose values carry their observation years.\n\nNull years stay in the input but never become endpoints or extremes. Ties\nfor an extreme resolve to its earliest recorded year.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "first_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change",
              "first_year",
              "last_year",
              "min_year",
              "max_year"
            ],
            "type": "object"
          },
          "Closed": {
            "additionalProperties": false,
            "description": "An object that must be empty: the bridge sends ``{}`` for it.",
            "properties": {},
            "type": "object"
          },
          "Flows_Annotated_dict_str__Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator____BeforeValidator__": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "type": "object"
              },
              "exports": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "type": "object"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator__": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "exports": {
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_SummaryStats_": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "$ref": "#/$defs/SummaryStats"
              },
              "exports": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_list_RankedEntity__": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "items": {
                  "$ref": "#/$defs/RankedEntity"
                },
                "type": "array"
              },
              "exports": {
                "items": {
                  "$ref": "#/$defs/RankedEntity"
                },
                "type": "array"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "HeadlineTrade": {
            "additionalProperties": false,
            "description": "The headline value and quantity of each flow, aligned to the periods.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "value_eur": {
                "$ref": "#/$defs/Flows_Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator__"
              },
              "quantity": {
                "$ref": "#/$defs/Flows_Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator__"
              }
            },
            "required": [
              "periods",
              "value_eur",
              "quantity"
            ],
            "type": "object"
          },
          "MarketSummaryChart": {
            "additionalProperties": false,
            "properties": {
              "headline_trade": {
                "$ref": "#/$defs/HeadlineTrade"
              },
              "top_partners": {
                "$ref": "#/$defs/RankedSeries"
              },
              "top_reporters": {
                "$ref": "#/$defs/RankedSeries"
              }
            },
            "required": [
              "headline_trade",
              "top_partners",
              "top_reporters"
            ],
            "type": "object"
          },
          "MarketSummaryLinks": {
            "additionalProperties": false,
            "properties": {
              "trade": {
                "type": "string"
              },
              "top_partners_by_value": {
                "type": "string"
              },
              "top_reporters_by_value": {
                "type": "string"
              },
              "concentration_hhi_value": {
                "type": "string"
              }
            },
            "required": [
              "trade",
              "top_partners_by_value",
              "top_reporters_by_value",
              "concentration_hhi_value"
            ],
            "type": "object"
          },
          "MarketSummaryLinksWithNir": {
            "additionalProperties": false,
            "properties": {
              "trade": {
                "type": "string"
              },
              "top_partners_by_value": {
                "type": "string"
              },
              "top_reporters_by_value": {
                "type": "string"
              },
              "concentration_hhi_value": {
                "type": "string"
              },
              "net_import_reliance_pct": {
                "type": "string"
              }
            },
            "required": [
              "trade",
              "top_partners_by_value",
              "top_reporters_by_value",
              "concentration_hhi_value",
              "net_import_reliance_pct"
            ],
            "type": "object"
          },
          "PlainWithNirNote": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_note": {
                "type": "string"
              },
              "customs_code": {
                "type": "string"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              },
              "partner_set": {
                "maxLength": 120,
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "periods": {
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "trade": {
                "$ref": "#/$defs/TradeFacts_TradeMeasures_"
              },
              "units": {
                "$ref": "#/$defs/UnitLabels"
              },
              "top_partners_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              },
              "concentration_hhi_value": {
                "$ref": "#/$defs/Flows_SummaryStats_"
              },
              "top_reporters_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              }
            },
            "required": [
              "net_import_reliance_note",
              "customs_code",
              "reporter",
              "partner_set",
              "frequency",
              "periods",
              "trade",
              "units",
              "top_partners_by_value",
              "concentration_hhi_value",
              "top_reporters_by_value"
            ],
            "type": "object"
          },
          "PlainWithNirPct": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "customs_code": {
                "type": "string"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              },
              "partner_set": {
                "maxLength": 120,
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "periods": {
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "trade": {
                "$ref": "#/$defs/TradeFacts_TradeMeasures_"
              },
              "units": {
                "$ref": "#/$defs/UnitLabels"
              },
              "top_partners_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              },
              "concentration_hhi_value": {
                "$ref": "#/$defs/Flows_SummaryStats_"
              },
              "top_reporters_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              }
            },
            "required": [
              "net_import_reliance_pct",
              "customs_code",
              "reporter",
              "partner_set",
              "frequency",
              "periods",
              "trade",
              "units",
              "top_partners_by_value",
              "concentration_hhi_value",
              "top_reporters_by_value"
            ],
            "type": "object"
          },
          "RankedEntity": {
            "additionalProperties": false,
            "description": "A ranked partner or reporter with its own summary.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change",
              "name"
            ],
            "type": "object"
          },
          "RankedSeries": {
            "additionalProperties": false,
            "description": "Each ranked entity's value series, aligned to the periods.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "value_eur": {
                "$ref": "#/$defs/Flows_Annotated_dict_str__Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator____BeforeValidator__"
              }
            },
            "required": [
              "periods",
              "value_eur"
            ],
            "type": "object"
          },
          "Section_PlainWithNirNote_MarketSummaryChart_MarketSummaryLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/PlainWithNirNote"
              },
              "chart_data": {
                "$ref": "#/$defs/MarketSummaryChart"
              },
              "links": {
                "$ref": "#/$defs/MarketSummaryLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_PlainWithNirPct_MarketSummaryChart_MarketSummaryLinksWithNir_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/PlainWithNirPct"
              },
              "chart_data": {
                "$ref": "#/$defs/MarketSummaryChart"
              },
              "links": {
                "$ref": "#/$defs/MarketSummaryLinksWithNir"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_SuppWithNirNote_MarketSummaryChart_MarketSummaryLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/SuppWithNirNote"
              },
              "chart_data": {
                "$ref": "#/$defs/MarketSummaryChart"
              },
              "links": {
                "$ref": "#/$defs/MarketSummaryLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_SuppWithNirPct_MarketSummaryChart_MarketSummaryLinksWithNir_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/SuppWithNirPct"
              },
              "chart_data": {
                "$ref": "#/$defs/MarketSummaryChart"
              },
              "links": {
                "$ref": "#/$defs/MarketSummaryLinksWithNir"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "SummaryStats": {
            "additionalProperties": false,
            "description": "First, last, extremes and change of a series. Any may be null when the\nseries has no usable value.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change"
            ],
            "type": "object"
          },
          "SuppTradeMeasures": {
            "additionalProperties": false,
            "description": "The measures of one flow once the code has a supplementary unit.",
            "properties": {
              "value_eur": {
                "$ref": "#/$defs/SummaryStats"
              },
              "quantity": {
                "$ref": "#/$defs/SummaryStats"
              },
              "price": {
                "$ref": "#/$defs/SummaryStats"
              },
              "supp_quantity": {
                "$ref": "#/$defs/SummaryStats"
              },
              "supp_price": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "value_eur",
              "quantity",
              "price",
              "supp_quantity",
              "supp_price"
            ],
            "type": "object"
          },
          "SuppUnitLabels": {
            "additionalProperties": false,
            "description": "The unit labels once the code has a supplementary unit.",
            "properties": {
              "value_eur": {
                "type": "string"
              },
              "quantity": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "supp_quantity": {
                "type": "string"
              },
              "supp_price": {
                "type": "string"
              }
            },
            "required": [
              "value_eur",
              "quantity",
              "price",
              "supp_quantity",
              "supp_price"
            ],
            "type": "object"
          },
          "SuppWithNirNote": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_note": {
                "type": "string"
              },
              "measure_note": {
                "type": "string"
              },
              "customs_code": {
                "type": "string"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              },
              "partner_set": {
                "maxLength": 120,
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "periods": {
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "trade": {
                "$ref": "#/$defs/TradeFacts_SuppTradeMeasures_"
              },
              "units": {
                "$ref": "#/$defs/SuppUnitLabels"
              },
              "top_partners_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              },
              "concentration_hhi_value": {
                "$ref": "#/$defs/Flows_SummaryStats_"
              },
              "top_reporters_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              }
            },
            "required": [
              "net_import_reliance_note",
              "measure_note",
              "customs_code",
              "reporter",
              "partner_set",
              "frequency",
              "periods",
              "trade",
              "units",
              "top_partners_by_value",
              "concentration_hhi_value",
              "top_reporters_by_value"
            ],
            "type": "object"
          },
          "SuppWithNirPct": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "measure_note": {
                "type": "string"
              },
              "customs_code": {
                "type": "string"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              },
              "partner_set": {
                "maxLength": 120,
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "periods": {
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "trade": {
                "$ref": "#/$defs/TradeFacts_SuppTradeMeasures_"
              },
              "units": {
                "$ref": "#/$defs/SuppUnitLabels"
              },
              "top_partners_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              },
              "concentration_hhi_value": {
                "$ref": "#/$defs/Flows_SummaryStats_"
              },
              "top_reporters_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              }
            },
            "required": [
              "net_import_reliance_pct",
              "measure_note",
              "customs_code",
              "reporter",
              "partner_set",
              "frequency",
              "periods",
              "trade",
              "units",
              "top_partners_by_value",
              "concentration_hhi_value",
              "top_reporters_by_value"
            ],
            "type": "object"
          },
          "TradeFacts_SuppTradeMeasures_": {
            "additionalProperties": false,
            "properties": {
              "exports": {
                "$ref": "#/$defs/SuppTradeMeasures"
              },
              "imports": {
                "$ref": "#/$defs/SuppTradeMeasures"
              },
              "balance_eur": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "exports",
              "imports",
              "balance_eur"
            ],
            "type": "object"
          },
          "TradeFacts_TradeMeasures_": {
            "additionalProperties": false,
            "properties": {
              "exports": {
                "$ref": "#/$defs/TradeMeasures"
              },
              "imports": {
                "$ref": "#/$defs/TradeMeasures"
              },
              "balance_eur": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "exports",
              "imports",
              "balance_eur"
            ],
            "type": "object"
          },
          "TradeMeasures": {
            "additionalProperties": false,
            "description": "The measures of one flow, without a supplementary unit.",
            "properties": {
              "value_eur": {
                "$ref": "#/$defs/SummaryStats"
              },
              "quantity": {
                "$ref": "#/$defs/SummaryStats"
              },
              "price": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "value_eur",
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "UnavailableSection": {
            "additionalProperties": false,
            "description": "A section whose upstream sources failed: the reason, empty slots\nelsewhere (the envelope keys stay stable for MCP consumers).",
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/Closed"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/Closed"
              },
              "available": {
                "const": false,
                "default": false,
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "UnitLabels": {
            "additionalProperties": false,
            "description": "The unit label of each measure.",
            "properties": {
              "value_eur": {
                "type": "string"
              },
              "quantity": {
                "type": "string"
              },
              "price": {
                "type": "string"
              }
            },
            "required": [
              "value_eur",
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/Section_PlainWithNirPct_MarketSummaryChart_MarketSummaryLinksWithNir_"
              },
              {
                "$ref": "#/$defs/Section_PlainWithNirNote_MarketSummaryChart_MarketSummaryLinks_"
              },
              {
                "$ref": "#/$defs/Section_SuppWithNirPct_MarketSummaryChart_MarketSummaryLinksWithNir_"
              },
              {
                "$ref": "#/$defs/Section_SuppWithNirNote_MarketSummaryChart_MarketSummaryLinks_"
              },
              {
                "$ref": "#/$defs/UnavailableSection"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_market_structure_summary",
      "description": "Report-section helper (\"Market structure\"): combines, in priority\norder, the intra-EU specialisation snapshot (`get_specialisation`,\nalready map-ready), partner-concentration detail (`get_concentration`,\nkeeping the top-8-by-value share breakdown as `chart_data` alongside the\ncondensed HHI trend) and, when a PRODCOM mapping exists for the customs\ncode, EU production volumes (`get_production_series`). These three are\nindependent data sources bundled only because they all describe \"market\nstructure\" -- the specialisation RSCA is trade-based and has no relation\nto the PRODCOM production figures; treat them as separate findings, not\na single connected story. `most_specialised_reporters` /\n`least_specialised_reporters` are pre-sorted by actual RSCA (highest/\nlowest first respectively) -- use them as-is rather than re-deriving a\nranking. `query.prodcom_code` is passed through untouched --\npicking among ambiguous PRODCOM mappings is left to the caller, never\nguessed here.\n\nReturns `{\"result\": {narrative_facts, chart_data, links, available,\nreason}}`.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "AnnualSummaryStats": {
            "additionalProperties": false,
            "description": "An annual series summary whose values carry their observation years.\n\nNull years stay in the input but never become endpoints or extremes. Ties\nfor an extreme resolve to its earliest recorded year.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "first_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change",
              "first_year",
              "last_year",
              "min_year",
              "max_year"
            ],
            "type": "object"
          },
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "Closed": {
            "additionalProperties": false,
            "description": "An object that must be empty: the bridge sends ``{}`` for it.",
            "properties": {},
            "type": "object"
          },
          "ConcentrationDetail": {
            "additionalProperties": false,
            "description": "Both flows' concentration: the HHI line and the entities behind it, as\nthe API's ``ConcentrationSide``.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "imports": {
                "$ref": "#/$defs/ConcentrationSide"
              },
              "exports": {
                "$ref": "#/$defs/ConcentrationSide"
              }
            },
            "required": [
              "periods",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "ConcentrationSide": {
            "additionalProperties": false,
            "description": "One indicator's HHI line plus the breakdown it is built from -- the\nwire mirror of ``core.computation.shapes.IndicatorComponents`` over a period\nSeries, with ``columns`` fixing the entity order (top-N + Others).",
            "properties": {
              "indicator": {
                "description": "The period-aligned HHI line (0-10000; higher = more concentrated).",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "columns": {
                "description": "The entity order the components are keyed by (top-N + Others).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{entity: period-aligned absolute values the HHI shares are computed from}.",
                "type": "object"
              }
            },
            "required": [
              "indicator",
              "columns",
              "components"
            ],
            "type": "object"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "EuProductionBlock": {
            "additionalProperties": false,
            "description": "EU27 production quantity, value and unit value of one basis, with the\ndata status of the EU figure -- the wire mirror of the EU\n``TripletGeoStatus``.  Arrays are parallel to the owning series' period axis.",
            "properties": {
              "quantity": {
                "description": "The period-aligned EU27 production quantity (the PRODCOM unit); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "value": {
                "description": "The period-aligned EU27 production value (EUR); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "price": {
                "description": "The period-aligned EU27 production unit value (value per quantity unit); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "data_status": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/DataStatusPayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit value's status; value and quantity read their own component cells. Null when the basis has no EU27 aggregate."
              }
            },
            "required": [
              "quantity",
              "value",
              "price",
              "data_status"
            ],
            "type": "object"
          },
          "Flows_HhiMeasures_": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "$ref": "#/$defs/HhiMeasures"
              },
              "exports": {
                "$ref": "#/$defs/HhiMeasures"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "HhiMeasures": {
            "additionalProperties": false,
            "properties": {
              "value": {
                "$ref": "#/$defs/SummaryStats"
              },
              "volume": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "value",
              "volume"
            ],
            "type": "object"
          },
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProductionStatusFacts": {
            "additionalProperties": false,
            "description": "Why EU27 production years are null, and which carry caveats.",
            "properties": {
              "null_years": {
                "additionalProperties": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "caveat_years": {
                "additionalProperties": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              }
            },
            "required": [
              "null_years",
              "caveat_years"
            ],
            "type": "object"
          },
          "ProductionVolumes": {
            "additionalProperties": false,
            "description": "The EU production block and its unit timeline on one annual axis.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "eu_total": {
                "$ref": "#/$defs/EuProductionBlock"
              },
              "quantity_units": {
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "eu_total",
              "quantity_units"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "ReporterShares": {
            "additionalProperties": false,
            "description": "A reporter's specialisation measures in the year of the map.",
            "properties": {
              "rsca": {
                "type": "number"
              },
              "rca": {
                "type": "number"
              },
              "prod_share": {
                "type": "number"
              },
              "total_share": {
                "type": "number"
              }
            },
            "required": [
              "rsca",
              "rca",
              "prod_share",
              "total_share"
            ],
            "type": "object"
          },
          "Section_StructureWithUnit_StructureChartWithProduction_StructureLinksWithProduction_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/StructureWithUnit"
              },
              "chart_data": {
                "$ref": "#/$defs/StructureChartWithProduction"
              },
              "links": {
                "$ref": "#/$defs/StructureLinksWithProduction"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_StructureWithoutProduction_StructureChartCore_StructureLinksCore_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/StructureWithoutProduction"
              },
              "chart_data": {
                "$ref": "#/$defs/StructureChartCore"
              },
              "links": {
                "$ref": "#/$defs/StructureLinksCore"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_StructureWithoutUnit_StructureChartWithProduction_StructureLinksWithProduction_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/StructureWithoutUnit"
              },
              "chart_data": {
                "$ref": "#/$defs/StructureChartWithProduction"
              },
              "links": {
                "$ref": "#/$defs/StructureLinksWithProduction"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Specialisation": {
            "additionalProperties": false,
            "description": "A ranked reporter with its specialisation measures.",
            "properties": {
              "rsca": {
                "type": "number"
              },
              "rca": {
                "type": "number"
              },
              "prod_share": {
                "type": "number"
              },
              "total_share": {
                "type": "number"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              }
            },
            "required": [
              "rsca",
              "rca",
              "prod_share",
              "total_share",
              "reporter"
            ],
            "type": "object"
          },
          "SpecialisationMap": {
            "additionalProperties": false,
            "properties": {
              "year": {
                "type": "integer"
              },
              "rsca_map": {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              "reporters": {
                "additionalProperties": {
                  "$ref": "#/$defs/ReporterShares"
                },
                "type": "object"
              }
            },
            "required": [
              "year",
              "rsca_map",
              "reporters"
            ],
            "type": "object"
          },
          "StructureChartCore": {
            "additionalProperties": false,
            "properties": {
              "specialisation_map": {
                "$ref": "#/$defs/SpecialisationMap"
              },
              "concentration_detail": {
                "$ref": "#/$defs/ConcentrationDetail"
              }
            },
            "required": [
              "specialisation_map",
              "concentration_detail"
            ],
            "type": "object"
          },
          "StructureChartWithProduction": {
            "additionalProperties": false,
            "properties": {
              "specialisation_map": {
                "$ref": "#/$defs/SpecialisationMap"
              },
              "concentration_detail": {
                "$ref": "#/$defs/ConcentrationDetail"
              },
              "production_volumes": {
                "$ref": "#/$defs/ProductionVolumes"
              }
            },
            "required": [
              "specialisation_map",
              "concentration_detail",
              "production_volumes"
            ],
            "type": "object"
          },
          "StructureLinksCore": {
            "additionalProperties": false,
            "properties": {
              "most_specialised_reporters": {
                "type": "string"
              },
              "least_specialised_reporters": {
                "type": "string"
              },
              "concentration_hhi": {
                "type": "string"
              }
            },
            "required": [
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi"
            ],
            "type": "object"
          },
          "StructureLinksWithProduction": {
            "additionalProperties": false,
            "properties": {
              "most_specialised_reporters": {
                "type": "string"
              },
              "least_specialised_reporters": {
                "type": "string"
              },
              "concentration_hhi": {
                "type": "string"
              },
              "production_quantity": {
                "type": "string"
              },
              "production_value": {
                "type": "string"
              }
            },
            "required": [
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi",
              "production_quantity",
              "production_value"
            ],
            "type": "object"
          },
          "StructureWithUnit": {
            "additionalProperties": false,
            "properties": {
              "production_quantity": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "production_value": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "quantity_unit_periods": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "quantity_comparable": {
                "type": "boolean"
              },
              "production_status": {
                "$ref": "#/$defs/ProductionStatusFacts"
              },
              "specialisation_year": {
                "type": "integer"
              },
              "most_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "least_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "concentration_hhi": {
                "$ref": "#/$defs/Flows_HhiMeasures_"
              },
              "production_available": {
                "const": true,
                "type": "boolean"
              },
              "production_unit": {
                "type": "string"
              }
            },
            "required": [
              "production_quantity",
              "production_value",
              "quantity_unit_periods",
              "quantity_comparable",
              "production_status",
              "specialisation_year",
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi",
              "production_available",
              "production_unit"
            ],
            "type": "object"
          },
          "StructureWithoutProduction": {
            "additionalProperties": false,
            "properties": {
              "specialisation_year": {
                "type": "integer"
              },
              "most_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "least_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "concentration_hhi": {
                "$ref": "#/$defs/Flows_HhiMeasures_"
              },
              "production_available": {
                "const": false,
                "type": "boolean"
              },
              "production_note": {
                "type": "string"
              }
            },
            "required": [
              "specialisation_year",
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi",
              "production_available",
              "production_note"
            ],
            "type": "object"
          },
          "StructureWithoutUnit": {
            "additionalProperties": false,
            "properties": {
              "production_quantity": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "production_value": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "quantity_unit_periods": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "quantity_comparable": {
                "type": "boolean"
              },
              "production_status": {
                "$ref": "#/$defs/ProductionStatusFacts"
              },
              "specialisation_year": {
                "type": "integer"
              },
              "most_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "least_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "concentration_hhi": {
                "$ref": "#/$defs/Flows_HhiMeasures_"
              },
              "production_available": {
                "const": true,
                "type": "boolean"
              }
            },
            "required": [
              "production_quantity",
              "production_value",
              "quantity_unit_periods",
              "quantity_comparable",
              "production_status",
              "specialisation_year",
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi",
              "production_available"
            ],
            "type": "object"
          },
          "SummaryStats": {
            "additionalProperties": false,
            "description": "First, last, extremes and change of a series. Any may be null when the\nseries has no usable value.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change"
            ],
            "type": "object"
          },
          "UnavailableSection": {
            "additionalProperties": false,
            "description": "A section whose upstream sources failed: the reason, empty slots\nelsewhere (the envelope keys stay stable for MCP consumers).",
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/Closed"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/Closed"
              },
              "available": {
                "const": false,
                "default": false,
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/Section_StructureWithUnit_StructureChartWithProduction_StructureLinksWithProduction_"
              },
              {
                "$ref": "#/$defs/Section_StructureWithoutUnit_StructureChartWithProduction_StructureLinksWithProduction_"
              },
              {
                "$ref": "#/$defs/Section_StructureWithoutProduction_StructureChartCore_StructureLinksCore_"
              },
              {
                "$ref": "#/$defs/UnavailableSection"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_volatility_summary",
      "description": "Report-section helper (\"Volatility & shocks\"): the entities analysed\nare picked by `get_volatility` (ranks by trade volume, reports each\none's CV) and by `get_price_shocks`/`get_supply_shocks` at default\nparameters (both already scoped to top-value partners via\n`cumulative_share=0.8`) -- never re-picked from the shocks themselves.\nRetries shock detection once with loosened thresholds before concluding\n\"no shocks\"; an empty result is itself a reportable finding, not a gap.\nWhen shocks are found, the top events by abnormality and their series\nare the section's findings; when none are found (even after the retry),\nstability is the finding. `get_pattern_shift` is intentionally not part\nof this bundle -- its before/after quadrant framing is too easily\nmisread; call it directly if you specifically need it.\n\nReturns `{\"result\": {narrative_facts, chart_data, links, available,\nreason}}`.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "Closed": {
            "additionalProperties": false,
            "description": "An object that must be empty: the bridge sends ``{}`` for it.",
            "properties": {},
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "Flows_VolatilityBarsBlock_": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "$ref": "#/$defs/VolatilityBarsBlock"
              },
              "exports": {
                "$ref": "#/$defs/VolatilityBarsBlock"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_list_VolatilityBar__": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "items": {
                  "$ref": "#/$defs/VolatilityBar"
                },
                "type": "array"
              },
              "exports": {
                "items": {
                  "$ref": "#/$defs/VolatilityBar"
                },
                "type": "array"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "PairSeries": {
            "additionalProperties": false,
            "description": "A pair's quantity and price series over the shock payload's period\naxis (the wire mirror of ``core.computation.shapes.PairSeries``).",
            "properties": {
              "quantity": {
                "description": "The period-aligned quantity series; null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "price": {
                "description": "The period-aligned price series; null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "Section_VolatilityFactsNoShocks_VolatilityChartCore_VolatilityLinksCore_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/VolatilityFactsNoShocks"
              },
              "chart_data": {
                "$ref": "#/$defs/VolatilityChartCore"
              },
              "links": {
                "$ref": "#/$defs/VolatilityLinksCore"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_VolatilityFactsWithShocks_VolatilityChartWithShocks_VolatilityLinksWithShocks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/VolatilityFactsWithShocks"
              },
              "chart_data": {
                "$ref": "#/$defs/VolatilityChartWithShocks"
              },
              "links": {
                "$ref": "#/$defs/VolatilityLinksWithShocks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "Series": {
            "additionalProperties": false,
            "description": "A periods axis with one value array aligned to it.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "values": {
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "values"
            ],
            "type": "object"
          },
          "ShockBlock": {
            "additionalProperties": false,
            "description": "One timeline phase of a shock event (the wire mirror of\n``core.computation.shapes.ShockPhase``).",
            "properties": {
              "type": {
                "$ref": "#/$defs/WireEnum_ShockBlockType_",
                "description": "The phase kind (e.g. baseline, decline, disruption, full_recovery for supply shocks; price spike/drop, volatile trade, return to baseline for price shocks)."
              },
              "start": {
                "description": "The phase's first period.",
                "format": "date",
                "type": "string"
              },
              "end": {
                "description": "The phase's last period (inclusive).",
                "format": "date",
                "type": "string"
              },
              "length": {
                "description": "The phase's length in periods.",
                "type": "integer"
              },
              "qty_mean": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Mean quantity per period over the phase (no-trade periods count as 0)."
              },
              "price_mean": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Volume-weighted mean price over the phase."
              },
              "qty_pct_to_baseline": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The phase's quantity as % of the baseline mean."
              },
              "price_pct_to_baseline": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The phase's price as % of the baseline mean."
              }
            },
            "required": [
              "type",
              "start",
              "end",
              "length",
              "qty_mean",
              "price_mean",
              "qty_pct_to_baseline",
              "price_pct_to_baseline"
            ],
            "type": "object"
          },
          "ShockEvent": {
            "additionalProperties": false,
            "description": "One detected shock: identity, magnitude vs. baseline, and the\ntimeline phases (the wire mirror of ``core.computation.shapes.DetectedShock``).",
            "properties": {
              "entity": {
                "description": "The entity (partner or reporter) the shock was detected for.",
                "type": "string"
              },
              "customs_code": {
                "description": "The customs code of the pair.",
                "type": "string"
              },
              "shift_pct": {
                "description": "The magnitude of the collapse/spike vs baseline (%).",
                "type": "number"
              },
              "baseline_cv": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The pair's usual volatility (CV) over the baseline window."
              },
              "abnormality": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "How unusual the event is vs the pair's own history (sigma for supply shocks, CV multiples for price shocks)."
              },
              "value_share": {
                "description": "The pair's share of the slice's total value.",
                "type": "number"
              },
              "center": {
                "description": "The period the shock is centred on (sharpest drop/spike).",
                "format": "date",
                "type": "string"
              },
              "series": {
                "$ref": "#/$defs/PairSeries",
                "description": "The pair's quantity/price series over the payload's period axis."
              },
              "blocks": {
                "description": "The timeline phases (empty when detection found none).",
                "items": {
                  "$ref": "#/$defs/ShockBlock"
                },
                "type": "array"
              }
            },
            "required": [
              "entity",
              "customs_code",
              "shift_pct",
              "baseline_cv",
              "abnormality",
              "value_share",
              "center",
              "series",
              "blocks"
            ],
            "type": "object"
          },
          "ShockEventFact": {
            "additionalProperties": false,
            "description": "A shock event as the narrative cites it: the chart's event (the API's\n``ShockEvent``) reduced to its measures, named by type and flow.",
            "properties": {
              "entity": {
                "type": "string"
              },
              "abnormality": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "shift_pct": {
                "type": "number"
              },
              "center": {
                "type": "string"
              },
              "value_share": {
                "type": "number"
              },
              "shock_type": {
                "$ref": "#/$defs/WireEnum_ShockType_"
              },
              "flow": {
                "$ref": "#/$defs/WireEnum_FlowKey_"
              }
            },
            "required": [
              "entity",
              "abnormality",
              "shift_pct",
              "center",
              "value_share",
              "shock_type",
              "flow"
            ],
            "type": "object"
          },
          "ShockEvents": {
            "additionalProperties": false,
            "description": "Each kind is an explicit ``null`` when its detection found nothing.",
            "properties": {
              "supply": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ShockKind"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "price": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ShockKind"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "supply",
              "price"
            ],
            "type": "object"
          },
          "ShockKind": {
            "additionalProperties": false,
            "description": "The events of one shock type, both flows, with the code's labels.",
            "properties": {
              "customs_code": {
                "type": "string"
              },
              "customs_code_label": {
                "type": "string"
              },
              "reporter_label": {
                "type": "string"
              },
              "partner_set_label": {
                "type": "string"
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "imports": {
                "$ref": "#/$defs/ShocksPayload"
              },
              "exports": {
                "$ref": "#/$defs/ShocksPayload"
              }
            },
            "required": [
              "customs_code",
              "customs_code_label",
              "reporter_label",
              "partner_set_label",
              "entity_level",
              "frequency",
              "levels",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "ShocksPayload": {
            "additionalProperties": false,
            "description": "The grouped supply-/price-shock payload -- the wire mirror of\n``core.computation.shapes.ShockIndicator`` (blocks nested under their event,\nperiods carried once).",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "events": {
                "description": "The detected shocks, ranked by abnormality.",
                "items": {
                  "$ref": "#/$defs/ShockEvent"
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "events"
            ],
            "type": "object"
          },
          "UnavailableSection": {
            "additionalProperties": false,
            "description": "A section whose upstream sources failed: the reason, empty slots\nelsewhere (the envelope keys stay stable for MCP consumers).",
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/Closed"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/Closed"
              },
              "available": {
                "const": false,
                "default": false,
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "VolatilityBar": {
            "additionalProperties": false,
            "description": "One entity's aggregate CV (0–∞, dimensionless): a row of the CV bars.",
            "properties": {
              "entity": {
                "description": "The entity (partner or reporter).",
                "type": "string"
              },
              "cv": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Coefficient of variation (stdev/mean) over the window; higher = swings more relative to its typical level."
              }
            },
            "required": [
              "entity",
              "cv"
            ],
            "type": "object"
          },
          "VolatilityBarsBlock": {
            "additionalProperties": false,
            "description": "The volatility bars of one flow, with the labels the chart needs.",
            "properties": {
              "customs_code": {
                "type": "string"
              },
              "customs_code_label": {
                "type": "string"
              },
              "customs_code_labels": {
                "$ref": "#/$defs/Closed"
              },
              "reporter_label": {
                "type": "string"
              },
              "partner_set_label": {
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor"
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_"
              },
              "flow": {
                "$ref": "#/$defs/WireEnum_Flow_"
              },
              "indicator": {
                "$ref": "#/$defs/WireEnum_Measure_"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "bars": {
                "items": {
                  "$ref": "#/$defs/VolatilityBar"
                },
                "type": "array"
              },
              "bars_series": {
                "additionalProperties": {
                  "$ref": "#/$defs/Series"
                },
                "type": "object"
              },
              "entities": {
                "items": {
                  "$ref": "#/$defs/Closed"
                },
                "type": "array"
              },
              "subcodes": {
                "items": {
                  "$ref": "#/$defs/Closed"
                },
                "type": "array"
              },
              "data": {
                "$ref": "#/$defs/Closed"
              },
              "series": {
                "$ref": "#/$defs/Closed"
              }
            },
            "required": [
              "customs_code",
              "customs_code_label",
              "customs_code_labels",
              "reporter_label",
              "partner_set_label",
              "frequency",
              "quantity_unit",
              "entity_level",
              "flow",
              "indicator",
              "levels",
              "bars",
              "bars_series",
              "entities",
              "subcodes",
              "data",
              "series"
            ],
            "type": "object"
          },
          "VolatilityChartCore": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "$ref": "#/$defs/Flows_VolatilityBarsBlock_"
              }
            },
            "required": [
              "volatility_bars"
            ],
            "type": "object"
          },
          "VolatilityChartWithShocks": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "$ref": "#/$defs/Flows_VolatilityBarsBlock_"
              },
              "shock_events": {
                "$ref": "#/$defs/ShockEvents"
              }
            },
            "required": [
              "volatility_bars",
              "shock_events"
            ],
            "type": "object"
          },
          "VolatilityFactsNoShocks": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "$ref": "#/$defs/Flows_list_VolatilityBar__"
              },
              "retry_used": {
                "type": "boolean"
              },
              "shocks_detected": {
                "const": false,
                "type": "boolean"
              }
            },
            "required": [
              "volatility_bars",
              "retry_used",
              "shocks_detected"
            ],
            "type": "object"
          },
          "VolatilityFactsWithShocks": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "$ref": "#/$defs/Flows_list_VolatilityBar__"
              },
              "retry_used": {
                "type": "boolean"
              },
              "shocks_detected": {
                "const": true,
                "type": "boolean"
              },
              "top_shock_events": {
                "items": {
                  "$ref": "#/$defs/ShockEventFact"
                },
                "type": "array"
              }
            },
            "required": [
              "volatility_bars",
              "retry_used",
              "shocks_detected",
              "top_shock_events"
            ],
            "type": "object"
          },
          "VolatilityLinksCore": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "type": "string"
              }
            },
            "required": [
              "volatility_bars"
            ],
            "type": "object"
          },
          "VolatilityLinksWithShocks": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "type": "string"
              },
              "top_shock_events": {
                "type": "string"
              }
            },
            "required": [
              "volatility_bars",
              "top_shock_events"
            ],
            "type": "object"
          },
          "WireEnum_EntityLevel_": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "WireEnum_FlowKey_": {
            "description": "A trade flow as the bridge names it in a ``Flows`` pair (``Flow`` is\nthe displayed form, ``Imports`` / ``Exports``).",
            "enum": [
              "imports",
              "exports"
            ],
            "type": "string"
          },
          "WireEnum_Flow_": {
            "description": "A trade flow, as displayed; the store codes it 1 (imports) and 2\n(exports).",
            "enum": [
              "Imports",
              "Exports"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ShockBlockType_": {
            "description": "One timeline phase of a detected shock (``ComextVolatility``): the\nbaseline, the shock itself, and the aftermath.",
            "enum": [
              "baseline",
              "exit",
              "disruption",
              "decline",
              "full_recovery",
              "partial_recovery",
              "depressed",
              "sporadic",
              "price spike",
              "price drop",
              "shock",
              "volatile trade",
              "price volatility",
              "volume volatility",
              "return to baseline",
              "post shock"
            ],
            "type": "string"
          },
          "WireEnum_ShockType_": {
            "description": "The two shock detections (``ComextVolatility.supply_shocks`` /\n``.price_shocks``).",
            "enum": [
              "supply",
              "price"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/Section_VolatilityFactsWithShocks_VolatilityChartWithShocks_VolatilityLinksWithShocks_"
              },
              {
                "$ref": "#/$defs/Section_VolatilityFactsNoShocks_VolatilityChartCore_VolatilityLinksCore_"
              },
              {
                "$ref": "#/$defs/UnavailableSection"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_autonomy_summary",
      "description": "Report-section helper (\"Autonomy & vulnerability\"): net import\nreliance (`get_net_import_reliance`) is always the headline fact/chart.\nTrade intensity and export propensity (`get_trade_intensity` /\n`get_export_propensity`) are both computed, then a deterministic\nsalience score -- distance from an unremarkable ~50% band, plus the\nmagnitude of its own change -- decides which one leads the narrative;\nthis choice is never left to the caller. `trade_intensity_pct` is\nreturned fully unit-consistent (first/last/min/max all expressed as a\npercentage, matching `export_propensity_pct`). Sub-contracting is\ndeliberately not included in this section at all -- it is an unrelated,\ntiny-base PRODCOM series that only muddied the narrative.\n\nReturns `{\"result\": {narrative_facts, chart_data, links, available,\nreason}}`.",
      "categories": [
        "advanced"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "AnnualSummaryStats": {
            "additionalProperties": false,
            "description": "An annual series summary whose values carry their observation years.\n\nNull years stay in the input but never become endpoints or extremes. Ties\nfor an extreme resolve to its earliest recorded year.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "first_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change",
              "first_year",
              "last_year",
              "min_year",
              "max_year"
            ],
            "type": "object"
          },
          "AutonomyFactsCore": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "trade_intensity_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "export_propensity_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              }
            },
            "required": [
              "net_import_reliance_pct",
              "trade_intensity_pct",
              "export_propensity_pct"
            ],
            "type": "object"
          },
          "AutonomyFactsWithSalience": {
            "additionalProperties": false,
            "properties": {
              "salience_leader": {
                "$ref": "#/$defs/WireEnum_ExposureIndicator_"
              },
              "salience_scores": {
                "$ref": "#/$defs/SalienceScores"
              },
              "net_import_reliance_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "trade_intensity_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "export_propensity_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              }
            },
            "required": [
              "salience_leader",
              "salience_scores",
              "net_import_reliance_pct",
              "trade_intensity_pct",
              "export_propensity_pct"
            ],
            "type": "object"
          },
          "AutonomyLinks": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_pct": {
                "type": "string"
              },
              "trade_intensity_pct": {
                "type": "string"
              },
              "export_propensity_pct": {
                "type": "string"
              }
            },
            "required": [
              "net_import_reliance_pct",
              "trade_intensity_pct",
              "export_propensity_pct"
            ],
            "type": "object"
          },
          "Closed": {
            "additionalProperties": false,
            "description": "An object that must be empty: the bridge sends ``{}`` for it.",
            "properties": {},
            "type": "object"
          },
          "IndicatorValues": {
            "additionalProperties": false,
            "description": "An autonomy indicator's values over the periods.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "indicator": {
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "indicator"
            ],
            "type": "object"
          },
          "SalienceScores": {
            "additionalProperties": false,
            "description": "Each indicator's salience score; null when the indicator has no value.",
            "properties": {
              "export_propensity": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "trade_intensity": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "export_propensity",
              "trade_intensity"
            ],
            "type": "object"
          },
          "Section_AutonomyFactsCore_dict_WireEnum_ExposureIndicator___IndicatorValues__AutonomyLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/AutonomyFactsCore"
              },
              "chart_data": {
                "additionalProperties": {
                  "$ref": "#/$defs/IndicatorValues"
                },
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ExposureIndicator_"
                },
                "type": "object"
              },
              "links": {
                "$ref": "#/$defs/AutonomyLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_AutonomyFactsWithSalience_dict_WireEnum_ExposureIndicator___IndicatorValues__AutonomyLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/AutonomyFactsWithSalience"
              },
              "chart_data": {
                "additionalProperties": {
                  "$ref": "#/$defs/IndicatorValues"
                },
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ExposureIndicator_"
                },
                "type": "object"
              },
              "links": {
                "$ref": "#/$defs/AutonomyLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "UnavailableSection": {
            "additionalProperties": false,
            "description": "A section whose upstream sources failed: the reason, empty slots\nelsewhere (the envelope keys stay stable for MCP consumers).",
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/Closed"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/Closed"
              },
              "available": {
                "const": false,
                "default": false,
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "WireEnum_ExposureIndicator_": {
            "description": "The three EU27 trade-exposure indicators.",
            "enum": [
              "net_import_reliance",
              "trade_intensity",
              "export_propensity"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "$ref": "#/$defs/Section_AutonomyFactsWithSalience_dict_WireEnum_ExposureIndicator___IndicatorValues__AutonomyLinks_"
              },
              {
                "$ref": "#/$defs/Section_AutonomyFactsCore_dict_WireEnum_ExposureIndicator___IndicatorValues__AutonomyLinks_"
              },
              {
                "$ref": "#/$defs/UnavailableSection"
              }
            ]
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    },
    {
      "name": "get_full_report",
      "description": "Fetch every report section (scope, overview, market structure,\nvolatility, autonomy) for one shared `query` (labels in `query.lang`)\nin a single call, instead\nof calling `get_customs_code_profile` / `get_market_summary` /\n`get_market_structure_summary` / `get_volatility_summary` /\n`get_autonomy_summary` separately yourself. Guarantees all five\nsections describe the exact same customs-code/reporter/partner/period\nslice -- five separate calls have no such guarantee, since nothing\nstops `query` from being re-typed slightly differently across them, or\none of the five simply being forgotten.\n\n`query`'s own field defaults (`reporter='European Union'`,\n`partner_set='non-EU countries'`, `period_start='2015-01'`,\n`frequency='quarter'`, `remove_outliers=true`, ...) are exactly the\nsensible defaults for a first-cut report; override any of them for a\ndifferent slice -- e.g. a specific Member State, a custom partner\ngroup, a narrower period.\n\nReturns `{\"result\": {\"query\": {...}, \"sections\": {<name>:\n{narrative_facts, chart_data, links, available, reason}, ...}}}` for\n`<name>` in `customs_code_profile`, `market_summary`, `market_structure`,\n`volatility`, `autonomy`. `links` maps each `narrative_facts` key to a\nready-made `https://tradedashboard.eu/...` URL for that same fact -- never\nconstruct one of these yourself; use the one already provided.",
      "categories": [
        "core"
      ],
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true
      },
      "inputSchema": {
        "$defs": {
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": {
                  "year": 2015,
                  "month": 1
                },
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          }
        },
        "additionalProperties": false,
        "properties": {
          "query": {
            "$ref": "#/$defs/DashboardQuery",
            "description": "The customs-code/reporter/partner-set/period/frequency slice to query -- the same request body every tradedashboard.eu analytical endpoint takes. See its own field descriptions (customs_code, baskets, reporter, partner_set, period_start, period_end, frequency, n_top, ...) for details; exactly one of `customs_code` and `baskets` is required, everything else has a sensible default."
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "outputSchema": {
        "$defs": {
          "AnnualSummaryStats": {
            "additionalProperties": false,
            "description": "An annual series summary whose values carry their observation years.\n\nNull years stay in the input but never become endpoints or extremes. Ties\nfor an extreme resolve to its earliest recorded year.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "first_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max_year": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change",
              "first_year",
              "last_year",
              "min_year",
              "max_year"
            ],
            "type": "object"
          },
          "AutonomyFactsCore": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "trade_intensity_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "export_propensity_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              }
            },
            "required": [
              "net_import_reliance_pct",
              "trade_intensity_pct",
              "export_propensity_pct"
            ],
            "type": "object"
          },
          "AutonomyFactsWithSalience": {
            "additionalProperties": false,
            "properties": {
              "salience_leader": {
                "$ref": "#/$defs/WireEnum_ExposureIndicator_"
              },
              "salience_scores": {
                "$ref": "#/$defs/SalienceScores"
              },
              "net_import_reliance_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "trade_intensity_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "export_propensity_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              }
            },
            "required": [
              "salience_leader",
              "salience_scores",
              "net_import_reliance_pct",
              "trade_intensity_pct",
              "export_propensity_pct"
            ],
            "type": "object"
          },
          "AutonomyLinks": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_pct": {
                "type": "string"
              },
              "trade_intensity_pct": {
                "type": "string"
              },
              "export_propensity_pct": {
                "type": "string"
              }
            },
            "required": [
              "net_import_reliance_pct",
              "trade_intensity_pct",
              "export_propensity_pct"
            ],
            "type": "object"
          },
          "Basket": {
            "additionalProperties": false,
            "description": "A nonempty tuple of pieces summed into one displayed line.",
            "properties": {
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The basket's display label; default: the pieces' codes joined with '+'."
              },
              "pieces": {
                "description": "The pieces summed into this basket.",
                "items": {
                  "$ref": "#/$defs/Piece"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "pieces"
            ],
            "type": "object"
          },
          "BundlingWithProdcom": {
            "additionalProperties": false,
            "properties": {
              "prodcom_mapping": {
                "$ref": "#/$defs/ProdcomMapping"
              },
              "is_bundling_heading": {
                "const": true,
                "type": "boolean"
              },
              "bundled_children": {
                "items": {
                  "$ref": "#/$defs/CodeLabel_CustomsCode_"
                },
                "type": "array"
              },
              "customs_code": {
                "type": "string"
              },
              "resolved_code": {
                "type": "string"
              },
              "resolved_label": {
                "type": "string"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "data_coverage": {
                "$ref": "#/$defs/CoverageWindow"
              },
              "code_valid_from": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "prodcom_mapping",
              "is_bundling_heading",
              "bundled_children",
              "customs_code",
              "resolved_code",
              "resolved_label",
              "levels",
              "data_coverage",
              "code_valid_from"
            ],
            "type": "object"
          },
          "BundlingWithoutProdcom": {
            "additionalProperties": false,
            "properties": {
              "is_bundling_heading": {
                "const": true,
                "type": "boolean"
              },
              "bundled_children": {
                "items": {
                  "$ref": "#/$defs/CodeLabel_CustomsCode_"
                },
                "type": "array"
              },
              "customs_code": {
                "type": "string"
              },
              "resolved_code": {
                "type": "string"
              },
              "resolved_label": {
                "type": "string"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "data_coverage": {
                "$ref": "#/$defs/CoverageWindow"
              },
              "code_valid_from": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "is_bundling_heading",
              "bundled_children",
              "customs_code",
              "resolved_code",
              "resolved_label",
              "levels",
              "data_coverage",
              "code_valid_from"
            ],
            "type": "object"
          },
          "CellSeries_ProdcomCellStatus_": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ProdcomCellStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomCellFlag__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "CellSeries_WireEnum_ProdcomGap__": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/$defs/WireEnum_ProdcomGap_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "Closed": {
            "additionalProperties": false,
            "description": "An object that must be empty: the bridge sends ``{}`` for it.",
            "properties": {},
            "type": "object"
          },
          "CodeLabel_CustomsCode_": {
            "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"
          },
          "ConcentrationDetail": {
            "additionalProperties": false,
            "description": "Both flows' concentration: the HHI line and the entities behind it, as\nthe API's ``ConcentrationSide``.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "imports": {
                "$ref": "#/$defs/ConcentrationSide"
              },
              "exports": {
                "$ref": "#/$defs/ConcentrationSide"
              }
            },
            "required": [
              "periods",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "ConcentrationSide": {
            "additionalProperties": false,
            "description": "One indicator's HHI line plus the breakdown it is built from -- the\nwire mirror of ``core.computation.shapes.IndicatorComponents`` over a period\nSeries, with ``columns`` fixing the entity order (top-N + Others).",
            "properties": {
              "indicator": {
                "description": "The period-aligned HHI line (0-10000; higher = more concentrated).",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "columns": {
                "description": "The entity order the components are keyed by (top-N + Others).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "components": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "description": "{entity: period-aligned absolute values the HHI shares are computed from}.",
                "type": "object"
              }
            },
            "required": [
              "indicator",
              "columns",
              "components"
            ],
            "type": "object"
          },
          "CoverageWindow": {
            "additionalProperties": false,
            "properties": {
              "data_min": {
                "description": "The first month with data inside the window ('YYYY-MM').",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "data_max": {
                "description": "The last month with data inside the window ('YYYY-MM').",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              }
            },
            "required": [
              "data_min",
              "data_max"
            ],
            "type": "object"
          },
          "DashboardQuery": {
            "additionalProperties": false,
            "description": "Shared request body for every analytical endpoint.\n\nOne customs-code selection (the ``customs_code`` shorthand or an explicit\n``baskets`` list -- exactly one of the two), one reporter (or group of\nreporters), a partner set, a period window and a frequency fully describe\na slice of Eurostat Comext/PRODCOM data. Individual endpoints read extra,\nendpoint-specific options from the query string (e.g. ``entity_level``,\n``flow``, ``partner``) rather than from this body.",
            "properties": {
              "reporter": {
                "default": "European Union",
                "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
                "maxLength": 120,
                "type": "string"
              },
              "group_reporters": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
              },
              "partner_set": {
                "default": "non-EU countries",
                "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
                "maxLength": 120,
                "type": "string"
              },
              "partners": {
                "anyOf": [
                  {
                    "items": {
                      "maxLength": 120,
                      "type": "string"
                    },
                    "maxItems": 300,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Explicit partner-country list that overrides 'partner_set' when present."
              },
              "period_start": {
                "default": "2015-01",
                "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/Frequency",
                "default": "quarter",
                "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'."
              },
              "remove_outliers": {
                "default": true,
                "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
                "type": "boolean"
              },
              "customs_code": {
                "anyOf": [
                  {
                    "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                    "type": "string"
                  },
                  {
                    "items": {
                      "description": "A canonical customs code, TOTAL, or a supported residual spelling.",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Combined Nomenclature customs code(s), 2–8 digits, or the literal 'TOTAL' meta-aggregate (all products combined). Residual customs codes are requestable too (e.g. 850440XX, 85SSS999, 85SSS); see https://tradedashboard.eu/faq-en.html#customscode for details. Pass a list to compare codes side by side, or to aggregate them in views that fold several codes into one basket: their volumes are summed and prices volume-weighted across every tab — except the Cross-section views, which keep each code separate. Exactly one of 'customs_code' and 'baskets' must be given.",
                "examples": [
                  "3801",
                  [
                    "0901",
                    "0902"
                  ],
                  "TOTAL",
                  "850440XX",
                  "85SSS"
                ]
              },
              "baskets": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/Basket"
                    },
                    "maxItems": 50,
                    "minItems": 1,
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The explicit basket form of the customs-code selection: a list of baskets, each a list of (customs_code, optional month window) pieces summed into one displayed line. Use it to clip a code to specific months or to chain successor codes (e.g. [{pieces: [{customs_code: '8524', to_month: '2006-12'}, {customs_code: '85241100', from_month: '2007-01'}]}] with a period starting before 2007). Every piece must meet the requested period. Exactly one of 'customs_code' and 'baskets' must be given."
              },
              "period_end": {
                "description": "Inclusive end of the analysis window, ISO month 'YYYY-MM'. Defaults to roughly three months ago — the latest period Eurostat typically has fully reported.",
                "pattern": "\\d{4}-\\d{2}",
                "type": "string"
              },
              "n_top": {
                "default": 7,
                "description": "Number of top entities (by volume/value) to break out individually in charts.",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "include_other": {
                "default": true,
                "description": "Bundle entities outside the top-N into a single 'Other' bucket.",
                "type": "boolean"
              },
              "include_residuals": {
                "default": true,
                "description": "Include the residual customs-code layer: residual rows in the breakdown views (subcode-compare, concentration-compare, volatility heatmap), the residual share in the response header and the related notes. False hides all of it; non-residual figures are unaffected.",
                "type": "boolean"
              },
              "lang": {
                "default": "en",
                "description": "Language for translated labels in the response: one of the listed ones (the languages the metadata exists in); any other is refused.",
                "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"
              }
            },
            "type": "object"
          },
          "DataStatusPayload": {
            "additionalProperties": false,
            "description": "Per-period data-quality breakdown of one PRODCOM figure -- the wire mirror\nof the core ``DataStatus``.  The DS-059358 vocabulary (the flag and gap\nenums, the ``ProdcomCellStatus`` of each component total) is\ncore's and validates and serializes as it is.  Arrays are parallel to the\nannotated block's own period axis; a period the figure does not cover\nreads null throughout.",
            "properties": {
              "availability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period: why the figure is null when a component is not usable; null = every component usable."
              },
              "gap": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomGap__",
                "description": "Per period: why the figure is null although every component is usable (a formula gap)."
              },
              "reliability": {
                "$ref": "#/$defs/CellSeries_WireEnum_ProdcomCellFlag__",
                "description": "Per period, on a numeric figure only: its main caveat. On an EU27 figure an estimate means the total includes national estimates."
              },
              "components": {
                "additionalProperties": {
                  "$ref": "#/$defs/CellSeries_ProdcomCellStatus_"
                },
                "description": "{component: per-period status, selected-code reasons and rounding band in that component's unit}.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomIndicator_"
                },
                "type": "object"
              }
            },
            "required": [
              "availability",
              "gap",
              "reliability",
              "components"
            ],
            "type": "object"
          },
          "DescriptionLevel": {
            "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"
              },
              "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."
              },
              "is_catch_all": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a catch-all ('other') level."
              },
              "siblings": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/CodeLabel_CustomsCode_"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "For a catch-all level, the ordinary siblings it excludes."
              },
              "segment": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for a historical segment's own definition."
              },
              "residual": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True for the synthetic level of a residual spelling."
              },
              "window": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/SegmentWindow"
                  },
                  {
                    "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"
          },
          "EuProductionBlock": {
            "additionalProperties": false,
            "description": "EU27 production quantity, value and unit value of one basis, with the\ndata status of the EU figure -- the wire mirror of the EU\n``TripletGeoStatus``.  Arrays are parallel to the owning series' period axis.",
            "properties": {
              "quantity": {
                "description": "The period-aligned EU27 production quantity (the PRODCOM unit); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "value": {
                "description": "The period-aligned EU27 production value (EUR); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "price": {
                "description": "The period-aligned EU27 production unit value (value per quantity unit); null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "data_status": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/DataStatusPayload"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit value's status; value and quantity read their own component cells. Null when the basis has no EU27 aggregate."
              }
            },
            "required": [
              "quantity",
              "value",
              "price",
              "data_status"
            ],
            "type": "object"
          },
          "Flows_Annotated_dict_str__Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator____BeforeValidator__": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "type": "object"
              },
              "exports": {
                "additionalProperties": {
                  "items": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "array"
                },
                "type": "object"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator__": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "exports": {
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_HhiMeasures_": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "$ref": "#/$defs/HhiMeasures"
              },
              "exports": {
                "$ref": "#/$defs/HhiMeasures"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_SummaryStats_": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "$ref": "#/$defs/SummaryStats"
              },
              "exports": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_VolatilityBarsBlock_": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "$ref": "#/$defs/VolatilityBarsBlock"
              },
              "exports": {
                "$ref": "#/$defs/VolatilityBarsBlock"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_list_RankedEntity__": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "items": {
                  "$ref": "#/$defs/RankedEntity"
                },
                "type": "array"
              },
              "exports": {
                "items": {
                  "$ref": "#/$defs/RankedEntity"
                },
                "type": "array"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Flows_list_VolatilityBar__": {
            "additionalProperties": false,
            "properties": {
              "imports": {
                "items": {
                  "$ref": "#/$defs/VolatilityBar"
                },
                "type": "array"
              },
              "exports": {
                "items": {
                  "$ref": "#/$defs/VolatilityBar"
                },
                "type": "array"
              }
            },
            "required": [
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "Frequency": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "FullReport": {
            "additionalProperties": false,
            "description": "``build_full_report``'s result: the query the sections share (as sent\nupstream: for a report, ``DashboardQuery.for_report``'s, labels in\n``Lang.labels_in``) beside the five sections.",
            "properties": {
              "query": {
                "$ref": "#/$defs/DashboardQuery"
              },
              "sections": {
                "$ref": "#/$defs/FullReportSections"
              }
            },
            "required": [
              "query",
              "sections"
            ],
            "type": "object"
          },
          "FullReportSections": {
            "additionalProperties": false,
            "description": "The five report sections of one shared query. A section whose upstream\nsources failed is an :class:`UnavailableSection` with its reason — the\nbundle fetcher drops or rejects it on its own policy.",
            "properties": {
              "customs_code_profile": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/Section_BundlingWithProdcom_Closed_ProfileLinks_"
                  },
                  {
                    "$ref": "#/$defs/Section_BundlingWithoutProdcom_Closed_ProfileLinks_"
                  },
                  {
                    "$ref": "#/$defs/Section_SingleWithProdcom_Closed_ProfileLinks_"
                  },
                  {
                    "$ref": "#/$defs/Section_SingleWithoutProdcom_Closed_ProfileLinks_"
                  },
                  {
                    "$ref": "#/$defs/UnavailableSection"
                  }
                ]
              },
              "market_summary": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/Section_PlainWithNirPct_MarketSummaryChart_MarketSummaryLinksWithNir_"
                  },
                  {
                    "$ref": "#/$defs/Section_PlainWithNirNote_MarketSummaryChart_MarketSummaryLinks_"
                  },
                  {
                    "$ref": "#/$defs/Section_SuppWithNirPct_MarketSummaryChart_MarketSummaryLinksWithNir_"
                  },
                  {
                    "$ref": "#/$defs/Section_SuppWithNirNote_MarketSummaryChart_MarketSummaryLinks_"
                  },
                  {
                    "$ref": "#/$defs/UnavailableSection"
                  }
                ]
              },
              "market_structure": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/Section_StructureWithUnit_StructureChartWithProduction_StructureLinksWithProduction_"
                  },
                  {
                    "$ref": "#/$defs/Section_StructureWithoutUnit_StructureChartWithProduction_StructureLinksWithProduction_"
                  },
                  {
                    "$ref": "#/$defs/Section_StructureWithoutProduction_StructureChartCore_StructureLinksCore_"
                  },
                  {
                    "$ref": "#/$defs/UnavailableSection"
                  }
                ]
              },
              "volatility": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/Section_VolatilityFactsWithShocks_VolatilityChartWithShocks_VolatilityLinksWithShocks_"
                  },
                  {
                    "$ref": "#/$defs/Section_VolatilityFactsNoShocks_VolatilityChartCore_VolatilityLinksCore_"
                  },
                  {
                    "$ref": "#/$defs/UnavailableSection"
                  }
                ]
              },
              "autonomy": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/Section_AutonomyFactsWithSalience_dict_WireEnum_ExposureIndicator___IndicatorValues__AutonomyLinks_"
                  },
                  {
                    "$ref": "#/$defs/Section_AutonomyFactsCore_dict_WireEnum_ExposureIndicator___IndicatorValues__AutonomyLinks_"
                  },
                  {
                    "$ref": "#/$defs/UnavailableSection"
                  }
                ]
              }
            },
            "required": [
              "customs_code_profile",
              "market_summary",
              "market_structure",
              "volatility",
              "autonomy"
            ],
            "type": "object"
          },
          "HeadlineTrade": {
            "additionalProperties": false,
            "description": "The headline value and quantity of each flow, aligned to the periods.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "value_eur": {
                "$ref": "#/$defs/Flows_Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator__"
              },
              "quantity": {
                "$ref": "#/$defs/Flows_Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator__"
              }
            },
            "required": [
              "periods",
              "value_eur",
              "quantity"
            ],
            "type": "object"
          },
          "HhiMeasures": {
            "additionalProperties": false,
            "properties": {
              "value": {
                "$ref": "#/$defs/SummaryStats"
              },
              "volume": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "value",
              "volume"
            ],
            "type": "object"
          },
          "IndicatorValues": {
            "additionalProperties": false,
            "description": "An autonomy indicator's values over the periods.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "indicator": {
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "indicator"
            ],
            "type": "object"
          },
          "MarketSummaryChart": {
            "additionalProperties": false,
            "properties": {
              "headline_trade": {
                "$ref": "#/$defs/HeadlineTrade"
              },
              "top_partners": {
                "$ref": "#/$defs/RankedSeries"
              },
              "top_reporters": {
                "$ref": "#/$defs/RankedSeries"
              }
            },
            "required": [
              "headline_trade",
              "top_partners",
              "top_reporters"
            ],
            "type": "object"
          },
          "MarketSummaryLinks": {
            "additionalProperties": false,
            "properties": {
              "trade": {
                "type": "string"
              },
              "top_partners_by_value": {
                "type": "string"
              },
              "top_reporters_by_value": {
                "type": "string"
              },
              "concentration_hhi_value": {
                "type": "string"
              }
            },
            "required": [
              "trade",
              "top_partners_by_value",
              "top_reporters_by_value",
              "concentration_hhi_value"
            ],
            "type": "object"
          },
          "MarketSummaryLinksWithNir": {
            "additionalProperties": false,
            "properties": {
              "trade": {
                "type": "string"
              },
              "top_partners_by_value": {
                "type": "string"
              },
              "top_reporters_by_value": {
                "type": "string"
              },
              "concentration_hhi_value": {
                "type": "string"
              },
              "net_import_reliance_pct": {
                "type": "string"
              }
            },
            "required": [
              "trade",
              "top_partners_by_value",
              "top_reporters_by_value",
              "concentration_hhi_value",
              "net_import_reliance_pct"
            ],
            "type": "object"
          },
          "PairSeries": {
            "additionalProperties": false,
            "description": "A pair's quantity and price series over the shock payload's period\naxis (the wire mirror of ``core.computation.shapes.PairSeries``).",
            "properties": {
              "quantity": {
                "description": "The period-aligned quantity series; null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              },
              "price": {
                "description": "The period-aligned price series; null = no figure.",
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "Piece": {
            "additionalProperties": false,
            "description": "Every declaration under one code in one optional month window.",
            "properties": {
              "customs_code": {
                "description": "The customs code: 2/4/6/8 digits, 'TOTAL', or a residual spelling (850440XX, 85SSS999, 85SSS).",
                "type": "string"
              },
              "from_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive first month of the window, ISO 'YYYY-MM'; null = the request's period_start."
              },
              "to_month": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Inclusive last month of the window, ISO 'YYYY-MM'; null = the request's period_end."
              }
            },
            "required": [
              "customs_code"
            ],
            "type": "object"
          },
          "PlainWithNirNote": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_note": {
                "type": "string"
              },
              "customs_code": {
                "type": "string"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              },
              "partner_set": {
                "maxLength": 120,
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "periods": {
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "trade": {
                "$ref": "#/$defs/TradeFacts_TradeMeasures_"
              },
              "units": {
                "$ref": "#/$defs/UnitLabels"
              },
              "top_partners_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              },
              "concentration_hhi_value": {
                "$ref": "#/$defs/Flows_SummaryStats_"
              },
              "top_reporters_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              }
            },
            "required": [
              "net_import_reliance_note",
              "customs_code",
              "reporter",
              "partner_set",
              "frequency",
              "periods",
              "trade",
              "units",
              "top_partners_by_value",
              "concentration_hhi_value",
              "top_reporters_by_value"
            ],
            "type": "object"
          },
          "PlainWithNirPct": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "customs_code": {
                "type": "string"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              },
              "partner_set": {
                "maxLength": 120,
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "periods": {
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "trade": {
                "$ref": "#/$defs/TradeFacts_TradeMeasures_"
              },
              "units": {
                "$ref": "#/$defs/UnitLabels"
              },
              "top_partners_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              },
              "concentration_hhi_value": {
                "$ref": "#/$defs/Flows_SummaryStats_"
              },
              "top_reporters_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              }
            },
            "required": [
              "net_import_reliance_pct",
              "customs_code",
              "reporter",
              "partner_set",
              "frequency",
              "periods",
              "trade",
              "units",
              "top_partners_by_value",
              "concentration_hhi_value",
              "top_reporters_by_value"
            ],
            "type": "object"
          },
          "ProdcomCellStatus": {
            "additionalProperties": false,
            "description": "The status of one total over every selected PRODCOM code.\n\nThe figure is usable exactly when no code blocks it and at least one code\nis usable. ``codes`` retains the reason for every non-exact contribution.",
            "properties": {
              "flag": {
                "$ref": "#/$defs/WireEnum_ProdcomCellFlag_",
                "description": "Headline: the main caveat of a usable total, else the main reason it is null."
              },
              "codes": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "The selected codes under every state other than exact.",
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "band": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Half-width of the rounding interval in this component's unit."
              },
              "band_unknown": {
                "description": "A rounded contribution has no usable base, so the band is unknown.",
                "type": "boolean"
              },
              "units": {
                "additionalProperties": {
                  "items": {
                    "description": "A dotted PRODCOM code.",
                    "examples": [
                      "23.99.14",
                      "24.10.T3.40"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "For different_unit: the selected codes recorded in another unit than the year's, grouped by that unit.",
                "type": "object"
              }
            },
            "required": [
              "flag",
              "codes",
              "band",
              "band_unknown",
              "units"
            ],
            "type": "object"
          },
          "ProdcomMapping": {
            "additionalProperties": false,
            "description": "The PRODCOM mapping, present for the codes PRODCOM covers.",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "reason": {
                "type": "null"
              },
              "prodcom_codes": {
                "items": {
                  "$ref": "#/$defs/ProdcomPickerCode"
                },
                "type": "array"
              }
            },
            "required": [
              "available",
              "reason",
              "prodcom_codes"
            ],
            "type": "object"
          },
          "ProdcomPickerCode": {
            "additionalProperties": false,
            "description": "One distinct data-bearing PRODCOM code of the code picker\n(``ProdcomNomenclature.deduplicate_resolved``): several mapped codes that\ncollapse onto the same aggregate appear once.",
            "properties": {
              "prodcom_code": {
                "description": "The data-bearing PRODCOM code, in dotted form on the wire.",
                "examples": [
                  "23.99.14",
                  "24.10.T3.40"
                ],
                "type": "string"
              },
              "description": {
                "description": "The code's label.",
                "type": "string"
              },
              "status": {
                "$ref": "#/$defs/WireEnum_ProdcomMappingStatus_",
                "description": "'exact' when the data-bearing code is a mapped code's own level, 'fallback' otherwise."
              },
              "original_prodcom_code_fmt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mapped dotted forms that fell back to this code (comma-joined); None for exact codes."
              }
            },
            "required": [
              "prodcom_code",
              "description",
              "status",
              "original_prodcom_code_fmt"
            ],
            "type": "object"
          },
          "ProductionStatusFacts": {
            "additionalProperties": false,
            "description": "Why EU27 production years are null, and which carry caveats.",
            "properties": {
              "null_years": {
                "additionalProperties": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              },
              "caveat_years": {
                "additionalProperties": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ProdcomCellFlag_"
                },
                "type": "object"
              }
            },
            "required": [
              "null_years",
              "caveat_years"
            ],
            "type": "object"
          },
          "ProductionVolumes": {
            "additionalProperties": false,
            "description": "The EU production block and its unit timeline on one annual axis.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "eu_total": {
                "$ref": "#/$defs/EuProductionBlock"
              },
              "quantity_units": {
                "items": {
                  "$ref": "#/$defs/QuantityUnitSpan"
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "eu_total",
              "quantity_units"
            ],
            "type": "object"
          },
          "ProfileLinks": {
            "additionalProperties": false,
            "properties": {
              "resolved_label": {
                "type": "string"
              }
            },
            "required": [
              "resolved_label"
            ],
            "type": "object"
          },
          "QuantityUnitSpan": {
            "additionalProperties": false,
            "description": "Consecutive years whose quantity totals and unit values are in one unit.",
            "properties": {
              "state": {
                "$ref": "#/$defs/WireEnum_QuantityUnitState_",
                "description": "recorded: every published quantity is in `unit`; mixed: totals are in `unit`, and a total holding a quantity in one of `other_units` is null (different_unit); not_recorded: the published quantities have no unit in the dump."
              },
              "unit": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/UnitDescriptor"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The unit of these years' quantity totals; null when not recorded."
              },
              "other_units": {
                "description": "Other units some selected codes publish quantities in; a total holding one is null. Empty when there is none.",
                "items": {
                  "$ref": "#/$defs/UnitDescriptor"
                },
                "type": "array"
              },
              "first": {
                "description": "First year of the span (first day of the year).",
                "format": "date",
                "type": "string"
              },
              "last": {
                "description": "Last year of the span.",
                "format": "date",
                "type": "string"
              }
            },
            "required": [
              "state",
              "unit",
              "other_units",
              "first",
              "last"
            ],
            "type": "object"
          },
          "RankedEntity": {
            "additionalProperties": false,
            "description": "A ranked partner or reporter with its own summary.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change",
              "name"
            ],
            "type": "object"
          },
          "RankedSeries": {
            "additionalProperties": false,
            "description": "Each ranked entity's value series, aligned to the periods.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "value_eur": {
                "$ref": "#/$defs/Flows_Annotated_dict_str__Annotated_list_Union_float__NoneType____BeforeValidator__AfterValidator____BeforeValidator__"
              }
            },
            "required": [
              "periods",
              "value_eur"
            ],
            "type": "object"
          },
          "ReporterShares": {
            "additionalProperties": false,
            "description": "A reporter's specialisation measures in the year of the map.",
            "properties": {
              "rsca": {
                "type": "number"
              },
              "rca": {
                "type": "number"
              },
              "prod_share": {
                "type": "number"
              },
              "total_share": {
                "type": "number"
              }
            },
            "required": [
              "rsca",
              "rca",
              "prod_share",
              "total_share"
            ],
            "type": "object"
          },
          "SalienceScores": {
            "additionalProperties": false,
            "description": "Each indicator's salience score; null when the indicator has no value.",
            "properties": {
              "export_propensity": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "trade_intensity": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "export_propensity",
              "trade_intensity"
            ],
            "type": "object"
          },
          "Section_AutonomyFactsCore_dict_WireEnum_ExposureIndicator___IndicatorValues__AutonomyLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/AutonomyFactsCore"
              },
              "chart_data": {
                "additionalProperties": {
                  "$ref": "#/$defs/IndicatorValues"
                },
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ExposureIndicator_"
                },
                "type": "object"
              },
              "links": {
                "$ref": "#/$defs/AutonomyLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_AutonomyFactsWithSalience_dict_WireEnum_ExposureIndicator___IndicatorValues__AutonomyLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/AutonomyFactsWithSalience"
              },
              "chart_data": {
                "additionalProperties": {
                  "$ref": "#/$defs/IndicatorValues"
                },
                "propertyNames": {
                  "$ref": "#/$defs/WireEnum_ExposureIndicator_"
                },
                "type": "object"
              },
              "links": {
                "$ref": "#/$defs/AutonomyLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_BundlingWithProdcom_Closed_ProfileLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/BundlingWithProdcom"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/ProfileLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_BundlingWithoutProdcom_Closed_ProfileLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/BundlingWithoutProdcom"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/ProfileLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_PlainWithNirNote_MarketSummaryChart_MarketSummaryLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/PlainWithNirNote"
              },
              "chart_data": {
                "$ref": "#/$defs/MarketSummaryChart"
              },
              "links": {
                "$ref": "#/$defs/MarketSummaryLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_PlainWithNirPct_MarketSummaryChart_MarketSummaryLinksWithNir_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/PlainWithNirPct"
              },
              "chart_data": {
                "$ref": "#/$defs/MarketSummaryChart"
              },
              "links": {
                "$ref": "#/$defs/MarketSummaryLinksWithNir"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_SingleWithProdcom_Closed_ProfileLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/SingleWithProdcom"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/ProfileLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_SingleWithoutProdcom_Closed_ProfileLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/SingleWithoutProdcom"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/ProfileLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_StructureWithUnit_StructureChartWithProduction_StructureLinksWithProduction_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/StructureWithUnit"
              },
              "chart_data": {
                "$ref": "#/$defs/StructureChartWithProduction"
              },
              "links": {
                "$ref": "#/$defs/StructureLinksWithProduction"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_StructureWithoutProduction_StructureChartCore_StructureLinksCore_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/StructureWithoutProduction"
              },
              "chart_data": {
                "$ref": "#/$defs/StructureChartCore"
              },
              "links": {
                "$ref": "#/$defs/StructureLinksCore"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_StructureWithoutUnit_StructureChartWithProduction_StructureLinksWithProduction_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/StructureWithoutUnit"
              },
              "chart_data": {
                "$ref": "#/$defs/StructureChartWithProduction"
              },
              "links": {
                "$ref": "#/$defs/StructureLinksWithProduction"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_SuppWithNirNote_MarketSummaryChart_MarketSummaryLinks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/SuppWithNirNote"
              },
              "chart_data": {
                "$ref": "#/$defs/MarketSummaryChart"
              },
              "links": {
                "$ref": "#/$defs/MarketSummaryLinks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_SuppWithNirPct_MarketSummaryChart_MarketSummaryLinksWithNir_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/SuppWithNirPct"
              },
              "chart_data": {
                "$ref": "#/$defs/MarketSummaryChart"
              },
              "links": {
                "$ref": "#/$defs/MarketSummaryLinksWithNir"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_VolatilityFactsNoShocks_VolatilityChartCore_VolatilityLinksCore_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/VolatilityFactsNoShocks"
              },
              "chart_data": {
                "$ref": "#/$defs/VolatilityChartCore"
              },
              "links": {
                "$ref": "#/$defs/VolatilityLinksCore"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "Section_VolatilityFactsWithShocks_VolatilityChartWithShocks_VolatilityLinksWithShocks_": {
            "additionalProperties": false,
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/VolatilityFactsWithShocks"
              },
              "chart_data": {
                "$ref": "#/$defs/VolatilityChartWithShocks"
              },
              "links": {
                "$ref": "#/$defs/VolatilityLinksWithShocks"
              },
              "available": {
                "const": true,
                "default": true,
                "type": "boolean"
              },
              "reason": {
                "default": null,
                "type": "null"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "SegmentWindow": {
            "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"
          },
          "Series": {
            "additionalProperties": false,
            "description": "A periods axis with one value array aligned to it.",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "values": {
                "items": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "values"
            ],
            "type": "object"
          },
          "ShockBlock": {
            "additionalProperties": false,
            "description": "One timeline phase of a shock event (the wire mirror of\n``core.computation.shapes.ShockPhase``).",
            "properties": {
              "type": {
                "$ref": "#/$defs/WireEnum_ShockBlockType_",
                "description": "The phase kind (e.g. baseline, decline, disruption, full_recovery for supply shocks; price spike/drop, volatile trade, return to baseline for price shocks)."
              },
              "start": {
                "description": "The phase's first period.",
                "format": "date",
                "type": "string"
              },
              "end": {
                "description": "The phase's last period (inclusive).",
                "format": "date",
                "type": "string"
              },
              "length": {
                "description": "The phase's length in periods.",
                "type": "integer"
              },
              "qty_mean": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Mean quantity per period over the phase (no-trade periods count as 0)."
              },
              "price_mean": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Volume-weighted mean price over the phase."
              },
              "qty_pct_to_baseline": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The phase's quantity as % of the baseline mean."
              },
              "price_pct_to_baseline": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The phase's price as % of the baseline mean."
              }
            },
            "required": [
              "type",
              "start",
              "end",
              "length",
              "qty_mean",
              "price_mean",
              "qty_pct_to_baseline",
              "price_pct_to_baseline"
            ],
            "type": "object"
          },
          "ShockEvent": {
            "additionalProperties": false,
            "description": "One detected shock: identity, magnitude vs. baseline, and the\ntimeline phases (the wire mirror of ``core.computation.shapes.DetectedShock``).",
            "properties": {
              "entity": {
                "description": "The entity (partner or reporter) the shock was detected for.",
                "type": "string"
              },
              "customs_code": {
                "description": "The customs code of the pair.",
                "type": "string"
              },
              "shift_pct": {
                "description": "The magnitude of the collapse/spike vs baseline (%).",
                "type": "number"
              },
              "baseline_cv": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The pair's usual volatility (CV) over the baseline window."
              },
              "abnormality": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "How unusual the event is vs the pair's own history (sigma for supply shocks, CV multiples for price shocks)."
              },
              "value_share": {
                "description": "The pair's share of the slice's total value.",
                "type": "number"
              },
              "center": {
                "description": "The period the shock is centred on (sharpest drop/spike).",
                "format": "date",
                "type": "string"
              },
              "series": {
                "$ref": "#/$defs/PairSeries",
                "description": "The pair's quantity/price series over the payload's period axis."
              },
              "blocks": {
                "description": "The timeline phases (empty when detection found none).",
                "items": {
                  "$ref": "#/$defs/ShockBlock"
                },
                "type": "array"
              }
            },
            "required": [
              "entity",
              "customs_code",
              "shift_pct",
              "baseline_cv",
              "abnormality",
              "value_share",
              "center",
              "series",
              "blocks"
            ],
            "type": "object"
          },
          "ShockEventFact": {
            "additionalProperties": false,
            "description": "A shock event as the narrative cites it: the chart's event (the API's\n``ShockEvent``) reduced to its measures, named by type and flow.",
            "properties": {
              "entity": {
                "type": "string"
              },
              "abnormality": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "shift_pct": {
                "type": "number"
              },
              "center": {
                "type": "string"
              },
              "value_share": {
                "type": "number"
              },
              "shock_type": {
                "$ref": "#/$defs/WireEnum_ShockType_"
              },
              "flow": {
                "$ref": "#/$defs/WireEnum_FlowKey_"
              }
            },
            "required": [
              "entity",
              "abnormality",
              "shift_pct",
              "center",
              "value_share",
              "shock_type",
              "flow"
            ],
            "type": "object"
          },
          "ShockEvents": {
            "additionalProperties": false,
            "description": "Each kind is an explicit ``null`` when its detection found nothing.",
            "properties": {
              "supply": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ShockKind"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "price": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ShockKind"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "supply",
              "price"
            ],
            "type": "object"
          },
          "ShockKind": {
            "additionalProperties": false,
            "description": "The events of one shock type, both flows, with the code's labels.",
            "properties": {
              "customs_code": {
                "type": "string"
              },
              "customs_code_label": {
                "type": "string"
              },
              "reporter_label": {
                "type": "string"
              },
              "partner_set_label": {
                "type": "string"
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "imports": {
                "$ref": "#/$defs/ShocksPayload"
              },
              "exports": {
                "$ref": "#/$defs/ShocksPayload"
              }
            },
            "required": [
              "customs_code",
              "customs_code_label",
              "reporter_label",
              "partner_set_label",
              "entity_level",
              "frequency",
              "levels",
              "imports",
              "exports"
            ],
            "type": "object"
          },
          "ShocksPayload": {
            "additionalProperties": false,
            "description": "The grouped supply-/price-shock payload -- the wire mirror of\n``core.computation.shapes.ShockIndicator`` (blocks nested under their event,\nperiods carried once).",
            "properties": {
              "periods": {
                "description": "The block's period axis (first day of each period); every array in this block is parallel to it.",
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "events": {
                "description": "The detected shocks, ranked by abnormality.",
                "items": {
                  "$ref": "#/$defs/ShockEvent"
                },
                "type": "array"
              }
            },
            "required": [
              "periods",
              "events"
            ],
            "type": "object"
          },
          "SingleWithProdcom": {
            "additionalProperties": false,
            "properties": {
              "prodcom_mapping": {
                "$ref": "#/$defs/ProdcomMapping"
              },
              "is_bundling_heading": {
                "const": false,
                "type": "boolean"
              },
              "customs_code": {
                "type": "string"
              },
              "resolved_code": {
                "type": "string"
              },
              "resolved_label": {
                "type": "string"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "data_coverage": {
                "$ref": "#/$defs/CoverageWindow"
              },
              "code_valid_from": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "prodcom_mapping",
              "is_bundling_heading",
              "customs_code",
              "resolved_code",
              "resolved_label",
              "levels",
              "data_coverage",
              "code_valid_from"
            ],
            "type": "object"
          },
          "SingleWithoutProdcom": {
            "additionalProperties": false,
            "properties": {
              "is_bundling_heading": {
                "const": false,
                "type": "boolean"
              },
              "customs_code": {
                "type": "string"
              },
              "resolved_code": {
                "type": "string"
              },
              "resolved_label": {
                "type": "string"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "data_coverage": {
                "$ref": "#/$defs/CoverageWindow"
              },
              "code_valid_from": {
                "anyOf": [
                  {
                    "description": "A calendar month, 'YYYY-MM'.",
                    "pattern": "\\d{4}-\\d{2}",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "is_bundling_heading",
              "customs_code",
              "resolved_code",
              "resolved_label",
              "levels",
              "data_coverage",
              "code_valid_from"
            ],
            "type": "object"
          },
          "Specialisation": {
            "additionalProperties": false,
            "description": "A ranked reporter with its specialisation measures.",
            "properties": {
              "rsca": {
                "type": "number"
              },
              "rca": {
                "type": "number"
              },
              "prod_share": {
                "type": "number"
              },
              "total_share": {
                "type": "number"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              }
            },
            "required": [
              "rsca",
              "rca",
              "prod_share",
              "total_share",
              "reporter"
            ],
            "type": "object"
          },
          "SpecialisationMap": {
            "additionalProperties": false,
            "properties": {
              "year": {
                "type": "integer"
              },
              "rsca_map": {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              "reporters": {
                "additionalProperties": {
                  "$ref": "#/$defs/ReporterShares"
                },
                "type": "object"
              }
            },
            "required": [
              "year",
              "rsca_map",
              "reporters"
            ],
            "type": "object"
          },
          "StructureChartCore": {
            "additionalProperties": false,
            "properties": {
              "specialisation_map": {
                "$ref": "#/$defs/SpecialisationMap"
              },
              "concentration_detail": {
                "$ref": "#/$defs/ConcentrationDetail"
              }
            },
            "required": [
              "specialisation_map",
              "concentration_detail"
            ],
            "type": "object"
          },
          "StructureChartWithProduction": {
            "additionalProperties": false,
            "properties": {
              "specialisation_map": {
                "$ref": "#/$defs/SpecialisationMap"
              },
              "concentration_detail": {
                "$ref": "#/$defs/ConcentrationDetail"
              },
              "production_volumes": {
                "$ref": "#/$defs/ProductionVolumes"
              }
            },
            "required": [
              "specialisation_map",
              "concentration_detail",
              "production_volumes"
            ],
            "type": "object"
          },
          "StructureLinksCore": {
            "additionalProperties": false,
            "properties": {
              "most_specialised_reporters": {
                "type": "string"
              },
              "least_specialised_reporters": {
                "type": "string"
              },
              "concentration_hhi": {
                "type": "string"
              }
            },
            "required": [
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi"
            ],
            "type": "object"
          },
          "StructureLinksWithProduction": {
            "additionalProperties": false,
            "properties": {
              "most_specialised_reporters": {
                "type": "string"
              },
              "least_specialised_reporters": {
                "type": "string"
              },
              "concentration_hhi": {
                "type": "string"
              },
              "production_quantity": {
                "type": "string"
              },
              "production_value": {
                "type": "string"
              }
            },
            "required": [
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi",
              "production_quantity",
              "production_value"
            ],
            "type": "object"
          },
          "StructureWithUnit": {
            "additionalProperties": false,
            "properties": {
              "production_quantity": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "production_value": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "quantity_unit_periods": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "quantity_comparable": {
                "type": "boolean"
              },
              "production_status": {
                "$ref": "#/$defs/ProductionStatusFacts"
              },
              "specialisation_year": {
                "type": "integer"
              },
              "most_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "least_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "concentration_hhi": {
                "$ref": "#/$defs/Flows_HhiMeasures_"
              },
              "production_available": {
                "const": true,
                "type": "boolean"
              },
              "production_unit": {
                "type": "string"
              }
            },
            "required": [
              "production_quantity",
              "production_value",
              "quantity_unit_periods",
              "quantity_comparable",
              "production_status",
              "specialisation_year",
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi",
              "production_available",
              "production_unit"
            ],
            "type": "object"
          },
          "StructureWithoutProduction": {
            "additionalProperties": false,
            "properties": {
              "specialisation_year": {
                "type": "integer"
              },
              "most_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "least_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "concentration_hhi": {
                "$ref": "#/$defs/Flows_HhiMeasures_"
              },
              "production_available": {
                "const": false,
                "type": "boolean"
              },
              "production_note": {
                "type": "string"
              }
            },
            "required": [
              "specialisation_year",
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi",
              "production_available",
              "production_note"
            ],
            "type": "object"
          },
          "StructureWithoutUnit": {
            "additionalProperties": false,
            "properties": {
              "production_quantity": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "production_value": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "quantity_unit_periods": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "quantity_comparable": {
                "type": "boolean"
              },
              "production_status": {
                "$ref": "#/$defs/ProductionStatusFacts"
              },
              "specialisation_year": {
                "type": "integer"
              },
              "most_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "least_specialised_reporters": {
                "items": {
                  "$ref": "#/$defs/Specialisation"
                },
                "type": "array"
              },
              "concentration_hhi": {
                "$ref": "#/$defs/Flows_HhiMeasures_"
              },
              "production_available": {
                "const": true,
                "type": "boolean"
              }
            },
            "required": [
              "production_quantity",
              "production_value",
              "quantity_unit_periods",
              "quantity_comparable",
              "production_status",
              "specialisation_year",
              "most_specialised_reporters",
              "least_specialised_reporters",
              "concentration_hhi",
              "production_available"
            ],
            "type": "object"
          },
          "SummaryStats": {
            "additionalProperties": false,
            "description": "First, last, extremes and change of a series. Any may be null when the\nseries has no usable value.",
            "properties": {
              "first": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pct_change": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "min",
              "max",
              "pct_change"
            ],
            "type": "object"
          },
          "SuppTradeMeasures": {
            "additionalProperties": false,
            "description": "The measures of one flow once the code has a supplementary unit.",
            "properties": {
              "value_eur": {
                "$ref": "#/$defs/SummaryStats"
              },
              "quantity": {
                "$ref": "#/$defs/SummaryStats"
              },
              "price": {
                "$ref": "#/$defs/SummaryStats"
              },
              "supp_quantity": {
                "$ref": "#/$defs/SummaryStats"
              },
              "supp_price": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "value_eur",
              "quantity",
              "price",
              "supp_quantity",
              "supp_price"
            ],
            "type": "object"
          },
          "SuppUnitLabels": {
            "additionalProperties": false,
            "description": "The unit labels once the code has a supplementary unit.",
            "properties": {
              "value_eur": {
                "type": "string"
              },
              "quantity": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "supp_quantity": {
                "type": "string"
              },
              "supp_price": {
                "type": "string"
              }
            },
            "required": [
              "value_eur",
              "quantity",
              "price",
              "supp_quantity",
              "supp_price"
            ],
            "type": "object"
          },
          "SuppWithNirNote": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_note": {
                "type": "string"
              },
              "measure_note": {
                "type": "string"
              },
              "customs_code": {
                "type": "string"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              },
              "partner_set": {
                "maxLength": 120,
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "periods": {
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "trade": {
                "$ref": "#/$defs/TradeFacts_SuppTradeMeasures_"
              },
              "units": {
                "$ref": "#/$defs/SuppUnitLabels"
              },
              "top_partners_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              },
              "concentration_hhi_value": {
                "$ref": "#/$defs/Flows_SummaryStats_"
              },
              "top_reporters_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              }
            },
            "required": [
              "net_import_reliance_note",
              "measure_note",
              "customs_code",
              "reporter",
              "partner_set",
              "frequency",
              "periods",
              "trade",
              "units",
              "top_partners_by_value",
              "concentration_hhi_value",
              "top_reporters_by_value"
            ],
            "type": "object"
          },
          "SuppWithNirPct": {
            "additionalProperties": false,
            "properties": {
              "net_import_reliance_pct": {
                "$ref": "#/$defs/AnnualSummaryStats"
              },
              "measure_note": {
                "type": "string"
              },
              "customs_code": {
                "type": "string"
              },
              "reporter": {
                "maxLength": 120,
                "type": "string"
              },
              "partner_set": {
                "maxLength": 120,
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "periods": {
                "items": {
                  "format": "date",
                  "type": "string"
                },
                "type": "array"
              },
              "trade": {
                "$ref": "#/$defs/TradeFacts_SuppTradeMeasures_"
              },
              "units": {
                "$ref": "#/$defs/SuppUnitLabels"
              },
              "top_partners_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              },
              "concentration_hhi_value": {
                "$ref": "#/$defs/Flows_SummaryStats_"
              },
              "top_reporters_by_value": {
                "$ref": "#/$defs/Flows_list_RankedEntity__"
              }
            },
            "required": [
              "net_import_reliance_pct",
              "measure_note",
              "customs_code",
              "reporter",
              "partner_set",
              "frequency",
              "periods",
              "trade",
              "units",
              "top_partners_by_value",
              "concentration_hhi_value",
              "top_reporters_by_value"
            ],
            "type": "object"
          },
          "TradeFacts_SuppTradeMeasures_": {
            "additionalProperties": false,
            "properties": {
              "exports": {
                "$ref": "#/$defs/SuppTradeMeasures"
              },
              "imports": {
                "$ref": "#/$defs/SuppTradeMeasures"
              },
              "balance_eur": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "exports",
              "imports",
              "balance_eur"
            ],
            "type": "object"
          },
          "TradeFacts_TradeMeasures_": {
            "additionalProperties": false,
            "properties": {
              "exports": {
                "$ref": "#/$defs/TradeMeasures"
              },
              "imports": {
                "$ref": "#/$defs/TradeMeasures"
              },
              "balance_eur": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "exports",
              "imports",
              "balance_eur"
            ],
            "type": "object"
          },
          "TradeMeasures": {
            "additionalProperties": false,
            "description": "The measures of one flow, without a supplementary unit.",
            "properties": {
              "value_eur": {
                "$ref": "#/$defs/SummaryStats"
              },
              "quantity": {
                "$ref": "#/$defs/SummaryStats"
              },
              "price": {
                "$ref": "#/$defs/SummaryStats"
              }
            },
            "required": [
              "value_eur",
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "UnavailableSection": {
            "additionalProperties": false,
            "description": "A section whose upstream sources failed: the reason, empty slots\nelsewhere (the envelope keys stay stable for MCP consumers).",
            "properties": {
              "narrative_facts": {
                "$ref": "#/$defs/Closed"
              },
              "chart_data": {
                "$ref": "#/$defs/Closed"
              },
              "links": {
                "$ref": "#/$defs/Closed"
              },
              "available": {
                "const": false,
                "default": false,
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "narrative_facts",
              "chart_data",
              "links",
              "available",
              "reason"
            ],
            "type": "object"
          },
          "UnitDescriptor": {
            "additionalProperties": false,
            "description": "A quantity/supplementary unit label (``supp_unit`` / ``quantity_units`` /\n``quantity_unit`` in response blocks).",
            "properties": {
              "unit_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's authority code (e.g. 'T', 'PST', '1000_KWH')."
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display label in the response's language."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The unit's display symbol (e.g. 't', 'l')."
              }
            },
            "required": [
              "unit_code",
              "label",
              "symbol"
            ],
            "type": "object"
          },
          "UnitLabels": {
            "additionalProperties": false,
            "description": "The unit label of each measure.",
            "properties": {
              "value_eur": {
                "type": "string"
              },
              "quantity": {
                "type": "string"
              },
              "price": {
                "type": "string"
              }
            },
            "required": [
              "value_eur",
              "quantity",
              "price"
            ],
            "type": "object"
          },
          "VolatilityBar": {
            "additionalProperties": false,
            "description": "One entity's aggregate CV (0–∞, dimensionless): a row of the CV bars.",
            "properties": {
              "entity": {
                "description": "The entity (partner or reporter).",
                "type": "string"
              },
              "cv": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Coefficient of variation (stdev/mean) over the window; higher = swings more relative to its typical level."
              }
            },
            "required": [
              "entity",
              "cv"
            ],
            "type": "object"
          },
          "VolatilityBarsBlock": {
            "additionalProperties": false,
            "description": "The volatility bars of one flow, with the labels the chart needs.",
            "properties": {
              "customs_code": {
                "type": "string"
              },
              "customs_code_label": {
                "type": "string"
              },
              "customs_code_labels": {
                "$ref": "#/$defs/Closed"
              },
              "reporter_label": {
                "type": "string"
              },
              "partner_set_label": {
                "type": "string"
              },
              "frequency": {
                "$ref": "#/$defs/WireEnum_Frequency_"
              },
              "quantity_unit": {
                "$ref": "#/$defs/UnitDescriptor"
              },
              "entity_level": {
                "$ref": "#/$defs/WireEnum_EntityLevel_"
              },
              "flow": {
                "$ref": "#/$defs/WireEnum_Flow_"
              },
              "indicator": {
                "$ref": "#/$defs/WireEnum_Measure_"
              },
              "levels": {
                "items": {
                  "$ref": "#/$defs/DescriptionLevel"
                },
                "type": "array"
              },
              "bars": {
                "items": {
                  "$ref": "#/$defs/VolatilityBar"
                },
                "type": "array"
              },
              "bars_series": {
                "additionalProperties": {
                  "$ref": "#/$defs/Series"
                },
                "type": "object"
              },
              "entities": {
                "items": {
                  "$ref": "#/$defs/Closed"
                },
                "type": "array"
              },
              "subcodes": {
                "items": {
                  "$ref": "#/$defs/Closed"
                },
                "type": "array"
              },
              "data": {
                "$ref": "#/$defs/Closed"
              },
              "series": {
                "$ref": "#/$defs/Closed"
              }
            },
            "required": [
              "customs_code",
              "customs_code_label",
              "customs_code_labels",
              "reporter_label",
              "partner_set_label",
              "frequency",
              "quantity_unit",
              "entity_level",
              "flow",
              "indicator",
              "levels",
              "bars",
              "bars_series",
              "entities",
              "subcodes",
              "data",
              "series"
            ],
            "type": "object"
          },
          "VolatilityChartCore": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "$ref": "#/$defs/Flows_VolatilityBarsBlock_"
              }
            },
            "required": [
              "volatility_bars"
            ],
            "type": "object"
          },
          "VolatilityChartWithShocks": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "$ref": "#/$defs/Flows_VolatilityBarsBlock_"
              },
              "shock_events": {
                "$ref": "#/$defs/ShockEvents"
              }
            },
            "required": [
              "volatility_bars",
              "shock_events"
            ],
            "type": "object"
          },
          "VolatilityFactsNoShocks": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "$ref": "#/$defs/Flows_list_VolatilityBar__"
              },
              "retry_used": {
                "type": "boolean"
              },
              "shocks_detected": {
                "const": false,
                "type": "boolean"
              }
            },
            "required": [
              "volatility_bars",
              "retry_used",
              "shocks_detected"
            ],
            "type": "object"
          },
          "VolatilityFactsWithShocks": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "$ref": "#/$defs/Flows_list_VolatilityBar__"
              },
              "retry_used": {
                "type": "boolean"
              },
              "shocks_detected": {
                "const": true,
                "type": "boolean"
              },
              "top_shock_events": {
                "items": {
                  "$ref": "#/$defs/ShockEventFact"
                },
                "type": "array"
              }
            },
            "required": [
              "volatility_bars",
              "retry_used",
              "shocks_detected",
              "top_shock_events"
            ],
            "type": "object"
          },
          "VolatilityLinksCore": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "type": "string"
              }
            },
            "required": [
              "volatility_bars"
            ],
            "type": "object"
          },
          "VolatilityLinksWithShocks": {
            "additionalProperties": false,
            "properties": {
              "volatility_bars": {
                "type": "string"
              },
              "top_shock_events": {
                "type": "string"
              }
            },
            "required": [
              "volatility_bars",
              "top_shock_events"
            ],
            "type": "object"
          },
          "WireEnum_EntityLevel_": {
            "description": "The geographic axis an analysis ranks or folds.",
            "enum": [
              "partner",
              "reporter"
            ],
            "type": "string"
          },
          "WireEnum_ExposureIndicator_": {
            "description": "The three EU27 trade-exposure indicators.",
            "enum": [
              "net_import_reliance",
              "trade_intensity",
              "export_propensity"
            ],
            "type": "string"
          },
          "WireEnum_FlowKey_": {
            "description": "A trade flow as the bridge names it in a ``Flows`` pair (``Flow`` is\nthe displayed form, ``Imports`` / ``Exports``).",
            "enum": [
              "imports",
              "exports"
            ],
            "type": "string"
          },
          "WireEnum_Flow_": {
            "description": "A trade flow, as displayed; the store codes it 1 (imports) and 2\n(exports).",
            "enum": [
              "Imports",
              "Exports"
            ],
            "type": "string"
          },
          "WireEnum_Frequency_": {
            "description": "The resampling frequency of a series.",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "type": "string"
          },
          "WireEnum_Measure_": {
            "description": "The measure an indicator, a ranking or a volatility measure is taken over:\nthe value, the quantity, or the price per unit (volatility only).",
            "enum": [
              "value",
              "quantity",
              "price"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomCellFlag_": {
            "description": "The state of one PRODCOM code's cell.\n\n``not_available`` and ``different_unit`` are assigned by aggregation and\nare never stored. Arithmetic reads the explicit properties below, not the\ndeclaration order: this is not a general severity ladder.",
            "enum": [
              "exact",
              "estimate",
              "valued_not_applicable",
              "rounded",
              "not_applicable",
              "confidential",
              "low_quality",
              "eu_totals_only",
              "unpublished_estimate",
              "undocumented_flag",
              "different_unit",
              "not_available"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomGap_": {
            "description": "Why an indicator is not computable although every component cell is\npresent: the formula-gap labels of a PRODCOM data status.",
            "enum": [
              "gap_negative_apparent",
              "gap_zero_denominator",
              "gap_no_production",
              "gap_no_quantity",
              "gap_no_total_production"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomIndicator_": {
            "description": "The DS-059358 indicators carried through every reshaped PRODCOM\nframe: one per *source* (a production basis, or a trade flow) and\n*measure*. Production is total sold production alongside its two\n2021-onward components (own account ``OWN*``, sub-contracted ``SC*``);\nimports/exports have no own/sub split and share the production QNTUNIT.\nPRODVAL is NOT assumed to equal own + sub (the series are reported and\nsuppressed independently).\n\nThe declaration order is the frame's column order: every value\nindicator, then every quantity one.",
            "enum": [
              "PRODVAL",
              "OWNPRODVAL",
              "SCPRODVAL",
              "IMPVAL",
              "EXPVAL",
              "PRODQNT",
              "OWNPRODQNT",
              "SCPRODQNT",
              "IMPQNT",
              "EXPQNT"
            ],
            "type": "string"
          },
          "WireEnum_ProdcomMappingStatus_": {
            "description": "How a PRODCOM code mapped to a customs code resolved against\nDS-059358 data.",
            "enum": [
              "exact",
              "fallback",
              "unavailable"
            ],
            "type": "string"
          },
          "WireEnum_QuantityUnitState_": {
            "description": "How a span of years records its quantity unit.",
            "enum": [
              "recorded",
              "mixed",
              "not_recorded"
            ],
            "type": "string"
          },
          "WireEnum_ShockBlockType_": {
            "description": "One timeline phase of a detected shock (``ComextVolatility``): the\nbaseline, the shock itself, and the aftermath.",
            "enum": [
              "baseline",
              "exit",
              "disruption",
              "decline",
              "full_recovery",
              "partial_recovery",
              "depressed",
              "sporadic",
              "price spike",
              "price drop",
              "shock",
              "volatile trade",
              "price volatility",
              "volume volatility",
              "return to baseline",
              "post shock"
            ],
            "type": "string"
          },
          "WireEnum_ShockType_": {
            "description": "The two shock detections (``ComextVolatility.supply_shocks`` /\n``.price_shocks``).",
            "enum": [
              "supply",
              "price"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false,
        "properties": {
          "result": {
            "$ref": "#/$defs/FullReport"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      }
    }
  ]
}
