get_trade_shift
Trade around a month you name (a tariff, a quota or another policy date; this service keeps no list of policies): for one HS code of 2, 4 or 6 digits, the months before the event month and the months from it (the event month included) are each compared with the same months a year earlier, so the season is the same on both sides. Returns each month (value in US dollars, weight in kg and their year-on-year changes), pre_yoy and post_yoy of the two windows, a front_loading status, the partners whose value rose most after the event, and with "country" a diversion block: the change of that partner, the change of all other partners (the two add up to total_change_usd) and how much of its fall the gains of the others make up (offset_ratio). front_loading is "consistent" when pre_yoy is at least +20% and post_yoy at most -10%; diversion is "consistent" when the partner fell and the gains of the others make up at least 50% of the fall. Use it for questions such as whether imports or exports of a product rose before a tariff date and fell after it, or whether a fall towards one partner was matched by gains elsewhere. These are our own convenience thresholds, not a standard; the statuses say whether the figures form a pattern consistent with front-loading or with a shift between partners, never that it happened. Front-loading, diversion, exchange rates, stocks, seasonality and classification changes cannot be told apart by these figures. The judgement uses the weight in kg (basis quantity_kg) when every month of the windows has a weight covering all of its value; otherwise it uses US-dollar values (basis value_usd), which include price and exchange-rate effects, and says so. A window that crosses a change in the source definition or the HS classification, or has a missing month, is null with a reason (definition_break, source_gap, withheld for an amount withheld by the publishing authority, or non_positive when the year-earlier total is zero), never zero. A partner month with no row counts as no trade only when the month is published, neither the code nor its HS2 chapter has a source gap that month, and there is no withheld (undisclosed) amount that month for the chapter or with an unknown chapter; otherwise that partner, and any partner with a row without a US-dollar value, is left out of top_gainers (gains_complete false; the gains summed are then only the known ones, a lower bound), and for the partner given in "country" the diversion is not_assessed with the reason. "country" cannot be the world total. Give "reporter", "flow", "code" and "event_month"; "before" and "after" are 1 to 12 months (default 6 each); "country" is the partner to look at (optional). The figures are our own calculation from public customs statistics, not official figures. Reference information computed mechanically from public statistics; not investment advice, a credit rating or a trading recommendation.
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>",
"flow": "<flow>",
"code": "<code>",
"event_month": "<event_month>"
},
"name": "get_trade_shift"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Required. HS code of 2, 4 or 6 digits; dots are ignored (for example "8703"). National codes are not accepted. | |
| flow | Yes | Required. "import" (goods entering the reporting country) or "export" (goods leaving it); there is no combined view: "both" does not exist. For a comparison across countries use compare_countries, for exports minus imports use get_balance. | |
| after | No | Optional. Months from the event month on, the event month included (1 to 12, default 6). Shortened to the latest published month. | |
| before | No | Optional. Months before the event month (1 to 12, default 6). | |
| country | No | Optional. The partner country to look at for a shift to other partners, as an ISO alpha-2 code or a name (for example "US"). Omit it for the partner gains only. | |
| reporter | Yes | 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. | |
| event_month | Yes | Required. The month of the policy or event, YYYY-MM. It is the first month of the after-window and must not be after the latest published month. |