Skip to main content
Glama

un-comtrade-mcp-server

Get Top Trade Commodities

comtrade_get_top_commodities
Read-only

Rank commodity categories for a reporter by trade value for a given flow direction and period. Returns the top N HS chapters (2-digit) or headings (4-digit) sorted by descending value — answers "what does country X mainly export?" or "what does country X mainly import?". Symmetric counterpart to comtrade_get_top_partners. Optionally filter to a single partner country.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of top commodity categories to return; above 50 returns all retrieved categories.
periodYesSingle period: annual (YYYY) or monthly (YYYYMM).
flow_codeYesTrade flow: M=imports, X=exports.
aggr_levelNoHS aggregation level: 2 = chapter (broader), 4 = heading (more specific).
partner_codeNoM49 partner code to filter to a specific bilateral relationship. Omit to rank commodities across all partners.
reporter_codeYesM49 numeric code of the reporting country.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoRecovery hint when no data is returned.
periodNoPeriod queried.
flowCodeNoFlow direction queried.
aggrLevelNoHS aggregation level used.
truncatedNoTrue when API returned 500 records and results may be incomplete.
commoditiesNoTop commodity categories sorted by descending trade value.
reporterCodeNoM49 reporter code.
reporterDescNoReporter country name.
totalValueUsdNoSum of primary values across all returned categories (before limit).
totalCommoditiesNoTotal commodity categories returned by API.

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.