Trade Flows & Rankings
tradeInternational TRADE STATISTICS — countries' import/export flows, partners, rankings and balances from UN Comtrade
(official customs data). NOT securities trading: it never places, routes or executes an order. Pick mode; each mode reads a subset of the params (see each param's note).
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": {
"mode": "<mode>"
},
"name": "trade"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow | No | export/import/both. Defaults: flows/top_partners=export, top_traders=import. | |
| freq | No | annual (default) | monthly (YYYYMM, goods only). flows only. | |
| mode | Yes | flows = one country's trade of a product over time · top_partners = a country's biggest trading partners for a product · top_traders = rank COUNTRIES by trade of a product (world/region) · balance = a country's trade balance (surplus/deficit). | |
| type | No | goods (default, HS) | services (EBOPS, value-only). flows/top_partners. | |
| codes | No | Product: HS code(s) OR a plain-English product ('copper','cars'), server-resolved. REQUIRED for flows/top_partners/top_traders; omit for balance → TOTAL (all goods). | |
| limit | No | top_partners/top_traders: top-N (default 10, max 50). | |
| order | No | top_traders only: desc (default) / asc; for streak = run direction. | |
| scope | No | top_traders only: world (default) / continent / subregion / econ group (asean/eu/g7) / CSV ISO-2. | |
| mirror | No | Also return the partner-reported figure + discrepancy (China esp.). flows only, goods. | |
| period | No | Year '2023' / list '2020,2021' / range '2015:2024' / 'lastN' / 'latest'. DYNAMIC — never hardcode. Defaults vary by mode. | |
| context | No | OPTIONAL but RECOMMENDED — the user's FULL request VERBATIM (any language). Used to pick the right code + SUPPLY STAGE (ore vs concentrate vs refined) and leaf-vs-family granularity for a `codes` concept. | |
| partner | No | Partner country, or 'World' (default). flows/balance only. | |
| rank_by | No | top_traders only: value (default) / growth (CAGR) / streak. | |
| reporter | No | Reporting country — name/ISO/M49 ('Thailand'/'THA'/'764'), server-resolved. REQUIRED for flows/top_partners/balance. | |
| min_value_usd | No | top_traders only: floor to drop tiny-base noise. |