Skip to main content
Glama

un-comtrade-mcp-server

Search HS Commodity Codes

comtrade_search_commodities
Read-only

Find HS commodity codes by keyword, partial description, or known code prefix. Returns matched codes at the requested aggregation level (2-, 4-, or 6-digit) with full descriptions, parent code, leaf status, and a recommended_query_code field indicating the best code level for subsequent trade queries (2-digit chapter for broad analysis, 4- or 6-digit for specific products). This is the critical resolution step — agents cannot derive HS codes from product names without this tool. Use aggr_level 2 to start broad; narrow with aggr_level 4 or 6 once you have a chapter. To get all commodities for an entire chapter, pass the 2-digit code as cmd_code in trade tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return; above 200 returns all matching codes.
queryYesKeyword, partial description, or HS code prefix to search for. Examples: "motor vehicles", "8471", "coffee", "84" (chapter 84 = machinery).
aggr_levelNoAggregation level: 2 = HS chapter (most general), 4 = heading, 6 = subheading (most specific). Omit to return all matching levels.
classificationNoHS classification version. "HS" covers the combined dataset across all editions (H0–H6). Use a specific edition (e.g. "H6") for version-specific lookups.HS

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
shownNoNumber of codes returned in this response.
noticeNoRecovery hint when no matches are found or results are truncated. Absent when results are non-empty and not truncated.
matchesNoHS codes matching the query.
truncatedNoTrue when matches were capped at the limit (totalMatches exceeds shown).
totalMatchesNoTotal matching codes (before limit truncation).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.