comtrade_list_commodities
Lists UN Comtrade commodity codes for a chosen classification and optionally filters them by code or description, helping you find valid product codes for trade data queries.
Instructions
List the product codes of one UN Comtrade classification, the values cmd_code takes.
Fetched live from upstream's public classification file <cl_code>.json (no key, no
quota) and kept for the life of the process: meta.retrieved_at is when the file
was fetched, the first call's time on a later one. The lists are large: "HS" has
8,262 codes (about 2 MB), each HS edition 6,000 to 7,000, SITC "SS" 7,863, BEC
"B5" 178, EBOPS "EB" 423, so search narrows them. Every row has id (the
code), text and parent; the goods files add is_leaf and aggr_level (0
for TOTAL, then 2, 4 and 6 digits for HS). meta.vintage stays None: the
files carry no release identifier.
Args:
cl_code: The classification, with a file upstream: "HS" (all HS editions
combined), an edition "H0" (1992) to "H6" (2022), SITC "SS"
(combined) or "S1" to "S4", BEC "B4" or "B5", EBOPS "EB"
(combined), "EB02", "EB10" or "EB10S". "BE" and "TM",
which get_data takes, have no file.
search: Keep the rows where this text occurs, ignoring case, in the code (id,
and cmd_code in SS) or the description (text, and
description_original in SS), e.g. "coffee", "crude",
"0901". HS texts start with the code ("0901 - Coffee, ..."). Omit for
every row.
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": {
"cl_code": "<cl_code>"
},
"name": "comtrade_list_commodities"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | No | ||
| cl_code | Yes |