comtrade_get_world_share
Retrieve each reporter's share of world trade by period with release dates, filtered by goods or services, annual/monthly frequency, period, and reporter code.
Instructions
List each reporter's share of world trade per period, with its release dates.
Upstream's public getWorldShare, "Get the World Share (including estimates)"; the
spec calls a row "A reporter's share of world trade for one period". The spec states
neither whether world_share (a Decimal) is a fraction or a percentage nor of
which trade; when recorded, the 214 values for 2023 (annual goods, every reporter) sum
to 1.0 and Switzerland's is 0.0165. A row with is_available false (47 of those 214)
still carries a world_share, but first_released and last_released read
0001-01-01T00:00:00, upstream's placeholder on unavailable datasets, kept as sent,
not a release; upstream states no meaning for is_available or data_count. The
four times (first_released, last_released, created, updated) are naive
datetimes: upstream prints them without a UTC offset and states no zone, so none is
attached. Keyless: no key is sent and no daily quota is spent, but the call shares the
client's pace (the Public tier allows 1 call per second) and its quota policy, so once
upstream has said the key's daily quota is spent it is held back too. Upstream's
subscription page limits the Public tier's preview API to 500 records a call; whether
that binds this operation is not stated, and the recorded answers (214 rows at most) did
not reach it. One call, rows in upstream's order; a period nobody reported returns an
empty list. The MCP tool returns up to 400 rows or 100 KB, so the whole 214-row answer
for one period reaches an agent; beyond that its note says to narrow by
reporter_code or period. Arguments are checked before the call; an unknown
reporter code raises UnknownCode, an InvalidRequestError naming the packaged
list and the closest area, another mistake InvalidRequestError.
Args:
type_code: "C" goods or "S" services.
freq_code: "A" annual or "M" monthly.
period: Years "2023" (annual) or months "202301" (monthly),
comma-separated, e.g. "2022,2023". The spec also lists "recent", which
is accepted, but upstream answered it with HTTP 500 on all three tries on
2026-10-28, with and without a reporter (ch_recent.json,
all_reporters_recent.json): the client makes 4 attempts (3 retries) on a
5xx and then raises UpstreamError, and what "recent" selects is
unknown, so name the periods. Omit for every period (64 annual rows for
Switzerland, 1962 to 2025).
reporter_code: Reporters, comma-separated, as list_reporters lists them:
"757" Switzerland, "842" USA, "156" China, "757,842". Omit for
every reporter (214 rows for 2023, annual goods).
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": {
"type_code": "<type_code>",
"freq_code": "<freq_code>"
},
"name": "comtrade_get_world_share"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | ||
| freq_code | Yes | ||
| type_code | Yes | ||
| reporter_code | No |