Skip to main content
Glama

comtrade_list_commodities

Read-onlyIdempotent

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

NameRequiredDescriptionDefault
searchNo
cl_codeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnlyHint, openWorldHint, idempotentHint, destructiveHint=false). The description adds genuine behavior beyond them: live fetch from a keyless, quota-free public file, process-lifetime caching with meta.retrieved_at semantics, vintage always None, return sizes, and per-row fields including is_leaf/aggr_level. The gap is that the caching caveat is stated as implementation detail without telling the agent when to distrust staleness.

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?

The opening sentence is front-loaded and efficient, and the Args blocks are cleanly separated. Some detail is dense, such as the parenthetical list of row counts and byte sizes, but nearly every sentence adds call-relevant information.

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

Completeness4/5

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

For a two-parameter tool with no output schema, it covers what an agent needs: valid cl_code values and their limits, filter semantics, row shape differences across classification families, and cache behavior. It does not say whether results are truncated or paginated when search is omitted on an 8,262-row classification.

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

Parameters5/5

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

With schema description coverage at 0%, the description carries parameter meaning and does so thoroughly: cl_code is enumerated across HS editions H0–H6, SITC SS/S1–S4, BEC B4/B5, EBOPS EB/EB02/EB10/EB10S, with an explicit warning that BE and TM have no file. search is defined case-insensitive, with which fields it matches on (including SS-specific fields) and concrete query examples.

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

Purpose4/5

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

The first sentence states a specific verb and resource: 'List the product codes of one UN Comtrade classification, the values cmd_code takes.' It ties the output to the cmd_code parameter consumed by comtrade_get_data, which distinguishes it from sibling list tools like comtrade_list_classifications. It does not explicitly contrast with comtrade_list_codes or comtrade_list_partners, keeping it below 5.

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

Usage Guidelines3/5

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

Usage is implied: the description says the lists are large and that 'search' narrows them, and explains which rows matching applies to. But it never says when to call this rather than comtrade_list_codes or comtrade_list_classifications, and offers no explicit when-not guidance.

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