Skip to main content
Glama

comtrade_list_codes

Read-onlyIdempotent

List valid values and upstream labels for a UN Comtrade parameter from packaged reference data, so you can choose accepted codes without an API call.

Instructions

List the values one UN Comtrade parameter takes, each with upstream's words for it.

Answered from the list packaged with this version (reference/<param>.json), without an upstream call; meta.endpoint is the reference file or the spec the list came from, meta.retrieved_at when the package fetched it, meta.vintage is None. Each row holds the value under the parameter's name in snake_case (flow_code, qty_unit_code) and upstream's words for it, under upstream's names: text from the reference files for flowCode (tradeRegimes.json), customsCode, motCode and mosCode; qty_abbr and qty_description for qtyUnitCode; variable and description from ListofReferences.json for clCode; for typeCode and freqCode text is the spec's wording ("C" commodities, "A" annual). A value the package takes from the spec carries none: "MIF" and "XIF" (flowCode), "BE" and "TM" (clCode), and breakdownMode and aggregateBy, whose descriptions word no value. mosCode lists ModeOfSupply.json's ids, not proven parameter values (data/v1/get refused "Mode 1" and accepted "0" and "1"). At most 41 rows (qtyUnitCode).

Args: param: The parameter, as upstream names it: "flowCode", "customsCode", "motCode", "clCode", "typeCode", "freqCode", "breakdownMode", "aggregateBy", "qtyUnitCode" or "mosCode".

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": {
      "param": "<param>"
    },
    "name": "comtrade_list_codes"
  }
}

Input Schema

NameRequiredDescriptionDefault
paramYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only declare the read-only, idempotent, non-destructive profile; the description goes well beyond them with the local-resolve behavior, the meta.endpoint / meta.retrieved_at / meta.vintage=None contract, the snake_case keying of each row, and the caveat that mosCode lists ModeOfSupply.json ids rather than proven parameter values (with the evidence that 'Mode 1' was refused and '0'/'1' accepted). It also bounds the result at 41 rows. This is exactly the kind of behavioral context annotations cannot carry; the only soft tension is openWorldHint=true versus a packaged, offline list, which the description surfaces honestly rather than hiding.

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 the local-answer behavior are front-loaded in the first two sentences, and most of the remaining density is justified because no output schema exists and the row shapes differ per parameter. It is still repetitive ('upstream's words for it' appears twice) and leans on reference filenames that an agent cannot act on, which is minor waste.

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 one-parameter lookup with no output schema, the description covers both inputs and return shape thoroughly, including per-parameter label keys and the spec-sourced values that carry no description. What it omits is the downstream connection — that these codes are the legal filter values for the comtrade_get_* tools — which would complete the picture for an agent deciding whether to call it.

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?

Schema coverage is 0% — a single bare string named 'param' with no description and no enum — so the description bears the full burden and discharges it by enumerating all ten accepted upstream names verbatim. It further explains that values are keyed under the snake_case form of each name, which the schema does not say. Without this, the tool would be effectively uncallable.

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 names a specific verb and resource: it lists the values a single UN Comtrade parameter takes, plus upstream's labels. That is concrete enough that an agent can separate it from data-fetching siblings and from the other list_* tools. It stops short of naming any sibling explicitly, so the differentiation is inferred from scope rather than stated.

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?

The statement that answers come from the packaged reference file without an upstream call implies the when-to-use case (you need valid code values locally, not a live query), but there is no explicit condition, no exclusion, and no pointer to comtrade_get_data or a sibling list tool as the alternative. Usage is inferable rather than prescribed.

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