/un-comtrade-mcp-server:un-comtrade-guidefrom un-comtrade-mcp-server
Use the comtrade_* tools for historical goods and services trade comparisons, partner and commodity rankings, bilateral balances, mirror analysis, and unit values. Resolve classification-specific identifiers and verify coverage before drawing conclusions.
Ships in un-comtrade-mcp-server. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use UN Comtrade for reported international merchandise and services trade. It does not provide tariff schedules, national tariff-line detail, or observed transaction prices. Keyless preview supports focused analysis; a configured subscription key changes upstream access, not the need to verify completeness.
comtrade_lookup_countries for the intended role. A partner area can be invalid as a reporter (World, Metropolitan France 250), while some groupings report (European Union, 97); validAsReporter and role settle it. Select the returned reporting identity rather than a familiar ISO numeric code: Comtrade's USA reporter is 842, while the similarly named 840 entry is not reporter-valid. comtrade://countries enumerates the reference entries when browsing is needed.comtrade_search_commodities. Keep codes as strings, including leading zeros. The default HS catalog is useful for discovery; use the selected HS edition or SITC revision for historical meanings. comtrade://hs-classification/{level} navigates the default HS hierarchy, not historical editions.comtrade_list_service_categories, which searches the combined EB catalog. Use its returned category and description together; numeric and SDMX category schemes coexist, so a familiar-looking code is not proof of meaning. Each category's schemes tags name the scheme catalogs (EB10, EB10S, EB02) that list its code.classificationCode. The same commodity code can change meaning across editions. Default HS queries return as-reported data, not a conversion to one common edition. Explicit HS editions are unavailable on keyless trade-data preview; do not silently replace an edition-converted request with HS.unservedPeriods, unservedReporters, unservedCmdCodes, and reportersWithoutRecords. Retrieve remaining periods, reporters, or codes separately. A reporter listed in reportersWithoutRecords returned no rows; read its referenceStatus and suggestedReporterCode before concluding it has no trade, since a partner-only code such as 250 reports as 251. Missing descriptions do not justify guessing a commodity's meaning.After resolving the product, inspect the available classifications and query a narrow period to establish the reported edition. Search that edition's catalog before extending the series. Keep each observation's edition visible. If product coverage changed, split the comparison or obtain a verified concordance; matching numeric codes alone do not establish comparability.
Use comtrade_get_trade_flows for the time series. Select World for an overall total or a particular partner for a bilateral series; omitting the partner requests a breakdown. Keep annual and monthly observations separate and use the tool's frequency contract.
Use comtrade_get_top_commodities for the product mix and comtrade_get_top_partners for suppliers or destinations of a selected product. Follow ranked entries into trade flows when quantities or historical detail are needed.
For commodity rankings, require coverageComplete before describing results as the leading categories. Read coverageNotice and unresolved-code metadata when coverage is incomplete; absent ranks or shares are not invitations to calculate them from the partial rows. denominatorValueUsd is matching TOTAL, while totalValueUsd is the retrieved-category sum. For partner rankings, the share denominator is totalValueUsd, the sum of every retrieved partner rather than only those shown; do not describe it as a World-total share without checking that total separately.
Use comtrade_get_trade_balance for a reporter's World or bilateral balance. Keep the same reporter on both sides of exports-minus-imports. The result is that reporter's account, not an average of two countries' reports.
For peer comparisons, comtrade_get_trade_flows accepts one reporter or several. For mirror analysis, omit the reporter only with an explicit partner, then retain each returned reporter's identity. Partners' imports from the target provide mirror evidence about the target's exports; partners' exports to it provide mirror evidence about its imports. Label this as mirror evidence, inspect coverage, and do not present it as the target's own report.
Use the services category catalog, not goods codes. Services trade queries default to EB, which serves each reporter-period in the scheme it was reported in; classification EB10 or EB02 selects UN Comtrade's converted series instead, and EB10S rows exist only under EB. Services availability defaults to EB10, so the availability classification and the row's actual classification serve different purposes: check availability with classification: "EB" to see the scheme each period was reported in. Inspect each row's classificationCode and isOriginalClassification (as reported or converted) and the category meanings before combining countries or years. A service_code returns rows only for periods reported in its scheme under EB. Omitting service_code returns every reported category at mixed levels, with totals (200 for EB10 and EB02, S for EB10S) beside their components; never sum those rows. This server's services queries are annual. From the reporter's perspective, imports are debits and exports are credits.
Use trade-flow records with a known value and a positive quantity in a known unit, or a positive net weight in kilograms. An absent qty, netWgt, or unit means the value was not reported; the server omits UN Comtrade's placeholder zeros, so never treat absence as zero. Read quantity-unit metadata and the quantity/weight estimation flags before computing a ratio. An absent flag does not establish that a value was measured. Never infer quantity units from the commodity code or combine quantities in unlike units.
Report the ratio as a trade unit value, with its unit, valuation basis, period, product scope, and estimation caveats. Customs trade values divided by quantities are not observed transaction prices; product mix and reporting differences can change the ratio without a price change.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
un-comtrade-mcp-server@cyanheads is listed by cyanheads/cyanheads — review the source before installing
npx claudepluginhub cyanheads/cyanheads --plugin un-comtrade-mcp-server