Skip to main content
Glama

TradeStats - customs trade statistics

get_mirror_trade

Two customs records of trade between two reporting countries: reporter's flow (export or import) with partner as the other side, next to the partner's opposite flow with the reporter as the other side. For example reporter JP, partner GB, flow export, code 8708 (auto parts) shows Japan's exports to the United Kingdom beside the United Kingdom's imports from Japan, for the same 12 months (ending at the latest month both sides have published), in US dollars with the weights. Returns each side's value, kg, basis (exports FOB, imports CIF; the US export value is FAS) and partner definition, the difference (import side minus export side) and the ratio (import side / export side). The import side is normally larger because it includes freight and insurance; differences also come from timing, classification and re-exports, and each country defines its partner differently (the UK counts imports by country of consignment). Works at HS6, HS4 and HS2 only. Use it to check one country's figure against the partner's record, or to see how large the valuation gap is; use compare_countries instead to compare more countries on one flow. Customs trade statistics of several reporting countries (Japan JP, United States US, United Kingdom GB, European Union (27 member states) EU) from their official customs data, monthly, by HS product code and partner country. value fields are in the reporter's currency (currency: JPY, USD, GBP or EUR) and _usd fields in US dollars; ratios and shares are fractions precomputed from the full dataset; every answer carries reporter, currency, data_through (latest published month), the reporter's attribution, and notes. Maximum 200 rows per answer. Numbers in answers are rounded once, at the end: amounts (value, _usd, v12 ...) to 2 decimals, quantity and kg to 3, unit prices (unit_price) to 4 significant digits below 100 and 2 decimals from 100 up (never rounded to 0), and ratios, shares and growth rates (yoy, mom*, share*, hhi*, chg3y) to 6; whole numbers and null are left as they are. A null quantity, kg or unit price comes with a *_unavailable_reason (mixed_units, weight_only, no_quantity_in_source, no_weight_in_source, source_gap, withheld; get_catalog lists them in null_reasons), and a missing seasonality with seasonality_unavailable_reason. The national level (JP 9-digit, US 10-digit, GB 8-digit, EU 8-digit codes) differs between reporters and between import and export; HS6, HS4 and HS2 are shared. Import and export are separate datasets, so reporter and flow are always required for product figures. Rankings (limit) are limited to the top 20 without an API key (more is refused with out_of_scope) and to 100 with a free API key. Start with get_catalog (coverage, your access limits, which tool to use) or, when you already know the code, get_item_summary for a one-call overview of a product.

Tool call template

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

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "reporter": "<reporter>",
      "partner": "<partner>",
      "code": "<code>",
      "flow": "<flow>"
    },
    "name": "get_mirror_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesHS product code with 2, 4 or 6 digits (e.g. "72" iron and steel, "854231" processors, "300490" medicines in dosage form; dots are ignored). National codes are rejected.
flowYesRequired. The direction on the reporter side: "export" (exports of the reporter to the partner, mirrored by imports of the partner from the reporter) or "import" (imports of the reporter from the partner, mirrored by exports of the partner to the reporter).
partnerYesRequired. The other reporting country, "JP", "US", "GB" or "EU" (not the same as reporter). Its opposite flow is read as the mirror, e.g. reporter "JP" flow "export" with partner "US" reads US imports from Japan.
reporterYesRequired. The reporting country whose customs statistics are read: "JP" (Japan), "US" (United States), "GB" (United Kingdom) or "EU" (European Union (27 member states)). Partners are the other countries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / partner / description
      Previous value: -"Required. The other reporting country, \"JP\", \"US\" or \"GB\" (not the same as reporter). Its opposite flow is read as the mirror, e.g. reporter \"JP\" flow \"export\" with partner \"US\" reads US imports from Japan."New value: +"Required. The other reporting country, \"JP\", \"US\", \"GB\" or \"EU\" (not the same as reporter). Its opposite flow is read as the mirror, e.g. reporter \"JP\" flow \"export\" with partner \"US\" reads US imports from Japan."
    • changedInput schema / properties / partner / enum
      Previous value: -[
      -  "JP",
      -  "US",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB",
      +  "EU"
      +]
    • changedInput schema / properties / reporter / description
      Previous value: -"Required. The reporting country whose customs statistics are read: \"JP\" (Japan), \"US\" (United States) or \"GB\" (United Kingdom). Partners are the other countries."New value: +"Required. The reporting country whose customs statistics are read: \"JP\" (Japan), \"US\" (United States), \"GB\" (United Kingdom) or \"EU\" (European Union (27 member states)). Partners are the other countries."
    • changedInput schema / properties / reporter / enum
      Previous value: -[
      -  "JP",
      -  "US",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB",
      +  "EU"
      +]
  2. Changed4 schema fields changed
    • changedInput schema / properties / partner / description
      Previous value: -"Required. The other reporting country, \"JP\" or \"GB\" (not the same as reporter). Its opposite flow is read as the mirror, e.g. reporter \"JP\" flow \"export\" with partner \"US\" reads US imports from Japan."New value: +"Required. The other reporting country, \"JP\", \"US\" or \"GB\" (not the same as reporter). Its opposite flow is read as the mirror, e.g. reporter \"JP\" flow \"export\" with partner \"US\" reads US imports from Japan."
    • changedInput schema / properties / partner / enum
      Previous value: -[
      -  "JP",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB"
      +]
    • changedInput schema / properties / reporter / description
      Previous value: -"Required. The reporting country whose customs statistics are read: \"JP\" (Japan) or \"GB\" (United Kingdom). Partners are the other countries."New value: +"Required. The reporting country whose customs statistics are read: \"JP\" (Japan), \"US\" (United States) or \"GB\" (United Kingdom). Partners are the other countries."
    • changedInput schema / properties / reporter / enum
      Previous value: -[
      -  "JP",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB"
      +]
  3. Changed4 schema fields changed
    • changedInput schema / properties / partner / description
      Previous value: -"Required. The other reporting country, \"JP\", \"US\", \"GB\" or \"EU\" (not the same as reporter). Its opposite flow is read as the mirror, e.g. reporter \"JP\" flow \"export\" with partner \"US\" reads US imports from Japan."New value: +"Required. The other reporting country, \"JP\" or \"GB\" (not the same as reporter). Its opposite flow is read as the mirror, e.g. reporter \"JP\" flow \"export\" with partner \"US\" reads US imports from Japan."
    • changedInput schema / properties / partner / enum
      Previous value: -[
      -  "JP",
      -  "US",
      -  "GB",
      -  "EU"
      -]New value: +[
      +  "JP",
      +  "GB"
      +]
    • changedInput schema / properties / reporter / description
      Previous value: -"Required. The reporting country whose customs statistics are read: \"JP\" (Japan), \"US\" (United States), \"GB\" (United Kingdom) or \"EU\" (European Union (27 member states)). Partners are the other countries."New value: +"Required. The reporting country whose customs statistics are read: \"JP\" (Japan) or \"GB\" (United Kingdom). Partners are the other countries."
    • changedInput schema / properties / reporter / enum
      Previous value: -[
      -  "JP",
      -  "US",
      -  "GB",
      -  "EU"
      -]New value: +[
      +  "JP",
      +  "GB"
      +]
  4. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it explains that the import side is normally larger (freight and insurance), that gaps also arise from timing, classification, re-exports and differing partner definitions (UK counts by country of consignment), and it discloses row caps, ranking limits without an API key, currency conventions, rounding rules and null-reason codes. That is substantive behavioral context an agent could not infer from structured fields.

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

Conciseness3/5

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

The core mirror concept is front-loaded and well structured, but the second half is a long block of cross-tool boilerplate (rounding rules, null reason codes, API-key limits) that is not specific to this operation and inflates the definition. It is readable but not tight.

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

Completeness5/5

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

With no output schema and no annotations, the description still tells the agent exactly what each side returns (value, kg, basis, partner definition, difference, ratio), the unit and currency conventions, and the data_through/notes envelope. Nothing essential for calling this tool correctly appears to be missing.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents all four parameters, including the flow enum and the partner-mirroring rule. The description still adds value by showing a concrete reporter/partner/flow/code combination and by stating the product-level constraint that the tool works only at HS6, HS4 and HS2, which the schema only partially conveys.

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

Purpose5/5

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

The description states a precise verb+resource: pairing the reporter's flow with the partner's opposite flow for the same 12 months. The worked example (reporter JP, partner GB, flow export, code 8708) makes the operation concrete, and it names compare_countries as the sibling that does something different, so an agent can select it without opening the schema.

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

Usage Guidelines5/5

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

It gives an explicit when-to-use ("check one country's figure against the partner's record, or to see how large the valuation gap is") and an explicit alternative for the other case ("use compare_countries instead to compare more countries on one flow"). It also provides entry-point routing: start with get_catalog, or get_item_summary when the code is already known.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources