usda_esr_list_countries
List ESR destination countries with their codes and regions to find the exact country_code values an ESR query needs. Filter by search text or region ID to narrow the results.
Instructions
List ESR's destination countries with their codes and regions, the values country_code takes.
Answered from ESRData_GetCountries as packaged with this version
(reference/countries.json), without an upstream call: 211 countries when
packaged, in upstream order, each with its ESR region (list_regions) and its GENC
code where upstream has one (50 have none). Codes are ESR's own, not ISO: 1220
CANADA, 2010 MEXICO, 5700 CHINA, PEOPLES REPUBLIC OF, 5880 JAPAN; 1 is
the EUROPEAN UNION - 27 aggregate and 9990 UNKNOWN. The names are upstream's,
padded with spaces, and kept so: country_name to eight characters
("CANADA "), country_description to 31 ("CANADA" and 25 spaces); only
9990 and the description of 1 are unpadded. meta.retrieved_at is when the
package fetched the list; meta.vintage is empty, as upstream gives the list no
release identifier.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "usda_esr_list_countries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | No | Keep the countries where this text occurs, ignoring case, in the code (as digits), the name, the description or the GENC code, e.g. ``"united"`` (4120 UNITED KINGDOM, 5200 UNITED ARAB EMIRATES, 7830 TANZANIA, UNITED REPUBLIC OF), ``"korea"`` (5790 and 5800), ``"DEU"`` (4280 GERMANY, by its GENC code), ``"1220"`` (CANADA). Omit (``None``) for every country. | |
| region_id | No | Keep the countries of this ESR region, an integer as ``list_regions`` gives it, e.g. ``11`` (WESTERN HEMISPHERE, 40 countries), ``10`` (AFRICA, 58), ``9`` (OTHER ASIA AND OCEANIA, 55), ``1`` (EUROPEAN UNION - 27, 27 countries, as upstream sends them: the aggregate ``1`` itself, ``4120`` UNITED KINGDOM and ``4230`` BELGIUM-LUXEMBOURG as one code besides 24 other members, while ``4791`` CROATIA sits in ``2`` OTHER EUROPE); ``5`` (JAPAN), ``6`` (TAIWAN), ``7`` (CHINA) and ``8`` (INDIA) hold one country each. Matched exactly, and checked against the packaged regions list first: an id it lacks, e.g. ``12``, raises ``InvalidRequestError`` naming the closest ids. Omit (``None``) for every region. |