Skip to main content
Glama

TradeStats - customs trade statistics

search_items

Find product codes of one reporter by words from the product name (customs wording, e.g. "lithium-ion", "frozen shrimp", "integrated circuits") or by a code prefix (digits, e.g. "8708" or "30"). Japanese words work too (kanji, katakana or hiragana) and search the Japanese product names of HS6, or of HS4/HS2 with level; each hit carries description_ja when a Japanese name exists. Use it first when you do not know the exact code; when you know the code, go straight to get_item_summary. Returns code, description, unit, and the first and last month with data. level defaults to hs6 on a build that serves HS6 and above (national-level series exist there only for a few listed codes; each hit says series_available, and for false gives hs6_parent), and to the reporter's national level (most detailed) on a build with full national series; use hs6/hs4/hs2 for broader groups (a code prefix with level hs4 or hs6 lists the codes under a chapter or heading, in code order and capped at limit, so a long list is cut off). Matching ignores case, hyphens and simple plurals, and knows common spelling variants (aluminum/aluminium, sulfur/sulphur, color/colour, tire/tyre) and one product synonym (passenger cars = motor cars); there are no other synonyms. Each hit says in available_in whether the code exists for import and/or export (with the period) and whether net trade (get_balance) is available. It returns codes, not trade values. Customs trade statistics of several reporting countries (Japan JP, United States US, United Kingdom GB, European Union (27 member states) EU) from their official customs data, monthly, by HS product code and partner country. value fields are in the reporter's currency (currency: JPY, USD, GBP or EUR) and _usd fields in US dollars; ratios and shares are fractions precomputed from the full dataset; every answer carries reporter, currency, data_through (latest published month), the reporter's attribution, and notes. Maximum 200 rows per answer. Numbers in answers are rounded once, at the end: amounts (value, _usd, v12 ...) to 2 decimals, quantity and kg to 3, unit prices (unit_price) to 4 significant digits below 100 and 2 decimals from 100 up (never rounded to 0), and ratios, shares and growth rates (yoy, mom*, share*, hhi*, chg3y) to 6; whole numbers and null are left as they are. A null quantity, kg or unit price comes with a *_unavailable_reason (mixed_units, weight_only, no_quantity_in_source, no_weight_in_source, source_gap, withheld; get_catalog lists them in null_reasons), and a missing seasonality with seasonality_unavailable_reason. The national level (JP 9-digit, US 10-digit, GB 8-digit, EU 8-digit codes) differs between reporters and between import and export; HS6, HS4 and HS2 are shared. Import and export are separate datasets, so reporter and flow are always required for product figures. Rankings (limit) are limited to the top 20 without an API key (more is refused with out_of_scope) and to 100 with a free API key. Start with get_catalog (coverage, your access limits, which tool to use) or, when you already know the code, get_item_summary for a one-call overview of a product.

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": {
      "reporter": "<reporter>",
      "query": "<query>",
      "flow": "<flow>"
    },
    "name": "search_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
flowYesRequired. "import" (goods entering the reporting country) or "export" (goods leaving it); there is no combined view: "both" does not exist. For a comparison across countries use compare_countries, for exports minus imports use get_balance.
levelNoCode level to search: the reporter's national level (JP hs9, US hs10, GB cn8, EU cn8), hs6, hs4 or hs2. Default: hs6 on a build that serves HS6 and above, otherwise the national level (most detailed; numbering differs between import and export).
limitNoMaximum results (default 20, max 50).
queryYesWords from the product name, all of which must match (e.g. "frozen shrimp", "semiconductor machines"), or digits for a code prefix (e.g. "8507", "3004"). Up to 6 words are used.
reporterYesRequired. The reporting country whose customs statistics are read: "JP" (Japan), "US" (United States), "GB" (United Kingdom) or "EU" (European Union (27 member states)). Partners are the other countries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / level / description
      Previous value: -"Code level to search: the reporter's national level (JP hs9, US hs10, GB cn8; EU has none), hs6, hs4 or hs2. Default: hs6 on a build that serves HS6 and above, otherwise the national level (most detailed; numbering differs between import and export)."New value: +"Code level to search: the reporter's national level (JP hs9, US hs10, GB cn8, EU cn8), hs6, hs4 or hs2. Default: hs6 on a build that serves HS6 and above, otherwise the national level (most detailed; numbering differs between import and export)."
  2. Changed2 schema fields changed
    • changedInput schema / properties / reporter / description
      Previous value: -"Required. The reporting country whose customs statistics are read: \"JP\" (Japan), \"US\" (United States) or \"GB\" (United Kingdom). Partners are the other countries."New value: +"Required. The reporting country whose customs statistics are read: \"JP\" (Japan), \"US\" (United States), \"GB\" (United Kingdom) or \"EU\" (European Union (27 member states)). Partners are the other countries."
    • changedInput schema / properties / reporter / enum
      Previous value: -[
      -  "JP",
      -  "US",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB",
      +  "EU"
      +]
  3. Changed2 schema fields changed
    • changedInput schema / properties / reporter / description
      Previous value: -"Required. The reporting country whose customs statistics are read: \"JP\" (Japan) or \"GB\" (United Kingdom). Partners are the other countries."New value: +"Required. The reporting country whose customs statistics are read: \"JP\" (Japan), \"US\" (United States) or \"GB\" (United Kingdom). Partners are the other countries."
    • changedInput schema / properties / reporter / enum
      Previous value: -[
      -  "JP",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB"
      +]
  4. Changed2 schema fields changed
    • changedInput schema / properties / reporter / description
      Previous value: -"Required. The reporting country whose customs statistics are read: \"JP\" (Japan), \"US\" (United States), \"GB\" (United Kingdom) or \"EU\" (European Union (27 member states)). Partners are the other countries."New value: +"Required. The reporting country whose customs statistics are read: \"JP\" (Japan) or \"GB\" (United Kingdom). Partners are the other countries."
    • changedInput schema / properties / reporter / enum
      Previous value: -[
      -  "JP",
      -  "US",
      -  "GB",
      -  "EU"
      -]New value: +[
      +  "JP",
      +  "GB"
      +]
  5. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it discloses normalization rules (case/hyphen/plural-insensitive, aluminum/aluminium, sulfur/sulphur, one product synonym), that prefixes with level hs4/hs6 truncate at limit in code order, per-hit fields like series_available and hs6_parent, and hard access limits (top 20 without a key, refused with out_of_scope). Points are lost because a large share of the text describes server-wide conventions - rounding, currency, null reasons, national digit counts - rather than this tool's own behavior.

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

Conciseness2/5

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

Purpose and the key alternative are front-loaded, but the bulk is a single dense paragraph mixing tool behavior with dataset boilerplate that cannot affect this tool's output - value-field rounding to 2 decimals, *_usd conversion, ratio precision to 6 places - even though the same text says 'It returns codes, not trade values'. Those sentences do not earn their place in a search-item definition.

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?

There is no output schema, and the description fills that gap directly by enumerating what each hit contains (code, description, unit, first/last month, available_in, series_available, hs6_parent, description_ja). Level defaults, prefix truncation, the 200-row answer cap and refusal behavior are all present, so nothing essential for calling it correctly 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 still adds meaning by explaining what level buys (broader groups, prefix listing in code order, capped at limit), that up to 6 query words are used and all must match, and that flow is always required because import and export are separate datasets. It does not resolve the tension between the schema's limit maximum of 50 and the prose's 100-with-key / 200-rows claims.

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?

States a concrete verb and resource ('Find product codes of one reporter') with both lookup modes spelled out - words from the product name, including Japanese scripts, or a code prefix. It explicitly contrasts itself with get_item_summary for the exact-code case, so an agent can distinguish it from siblings without opening any schema.

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

Usage Guidelines5/5

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

Gives an explicit selection rule: 'Use it first when you do not know the exact code; when you know the code, go straight to get_item_summary', plus entry points via get_catalog. It also scopes the tool by stating there is no combined import/export view and that comparisons belong in compare_countries or get_balance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources