Skip to main content
Glama

usda_esr_list_countries

Read-onlyIdempotent

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

NameRequiredDescriptionDefault
searchNoKeep 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_idNoKeep 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only/idempotent/non-destructive, and the description layers on genuine behavior: 211 rows served from a packaged file with no upstream call, upstream ordering, 50 entries lacking a GENC code, and the space-padded name/description fields down to the character counts and the two unpadded exceptions. It also explains meta.retrieved_at and the empty meta.vintage, which an agent could not infer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and provenance are front-loaded, and most sentences carry non-obvious facts (code scheme, padding, meta semantics). It is long and parenthetical-heavy for a two-parameter list tool, with several illustrative examples that could be trimmed without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description must describe the return shape, and it does: country_code, country_name, country_description, ESR region, optional GENC code, ordering, row count, and the meta fields. Nothing an agent needs to interpret or filter the response is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns more by stressing that codes are ESR's own rather than ISO ('1220' CANADA, '1' the EU-27 aggregate), which directly shapes what a valid search string looks like, plus region-id validation behavior raising InvalidRequestError. The padding details relevant to matching appear in the body rather than beside the search parameter, leaving a small gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ('List ESR's destination countries with their codes and regions') and immediately ties the output to its downstream use ('the values country_code takes'). It also distinguishes itself from list_regions by naming that sibling and cross-referencing its region ids.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Establishes the tool as a local lookup ('without an upstream call') and points to list_regions for region identity, giving clear context for when to reach for it. It stops short of an explicit when-to-use/when-not statement against other code-list siblings (e.g. the faostat_list_* family), so it is clear but not fully routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.