Skip to main content
Glama

un-comtrade-mcp-server

Server Details

UN Comtrade international trade statistics via MCP. Country/HS lookups, flows, balances, rankings.

If you are the author of this connector, you can claim ownership by verifying the domain or GitHub account it belongs to. Claimed connector authors can inspect health checks, view analytics, and manage their listing.
Status
Healthy
Uptime
99.8% over 22 days
Last Tested
Transport
Streamable HTTP · MCP 2025-11-25
URL
Repository
cyanheads/un-comtrade-mcp-server
GitHub Stars
4
Server Listing
@cyanheads/un-comtrade-mcp-server
ChatGPT
–
Claude
–

TDQS

A4.2/5.0

Scored across 9 tools

Disambiguation4/5

Each tool has a distinct role: flows are the raw retrieval, top_commodities/top_partners are ranking helpers, balance is a derived metric, and services trade is a separate domain. The only mild overlap is between get_trade_flows and get_trade_balance (which could be computed from flows) and between the two 'top' tools, but descriptions make the boundaries clear.

Naming Consistency5/5

All nine tools use the same comtrade_ prefix followed by a verb_noun pattern (get_data_availability, list_service_categories, lookup_countries, search_commodities). Verb choices are consistent with intent—get for data, list/search/lookup for reference resolution.

Tool Count5/5

Nine tools is well within the ideal range and each earns its place: two reference lookups plus one service catalog, an availability pre-check, a core flows retriever, and three convenience analytics. Nothing appears redundant or padding.

Completeness4/5

The surface covers the full workflow: resolve codes, check availability, fetch flows/services, and derive rankings and balances. Minor gaps remain—no reporter/partner enumeration tool, no metadata endpoint for classification editions or units, and services ranking is absent—but agents can work around these with the lookup tools.

Available Tools

9 tools
comtrade_get_data_availabilityCheck Data AvailabilityA
Read-only
Inspect

Check which reporter/period/classification combinations have published data before constructing expensive trade queries. Returns dataset records with period, classification, record count, and first/latest release dates. Call this before querying recent periods — annual data is typically published 3–12 months after the reference year and not all countries report every year. Omit filters to browse the availability index, 50 rows by default. Continue with nextOffset using the same filters and limit.

NameRequiredDescriptionDefault
freqNoFrequency: A=annual YYYY, M=monthly YYYYMM (01–12).A
limitNoMaximum datasets returned per page; defaults to 50.
offsetNoNumber of matching datasets to skip; use nextOffset to continue.
periodNoPeriod to check: YYYY (annual) or YYYYMM (monthly). Omit to see all available periods for the reporter.
type_codeNoTrade type: C=commodities (goods), S=services.C
reporter_codeNoM49 reporter code to check. Omit to browse availability across all reporters.
classificationNoClassification code filter (e.g. "HS", "H6", "EB10"). Omitted or blank defaults to HS for goods and EB10 for services.

Output Schema

NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
shownNoNumber of datasets returned on this page.
noticeNoRecovery hint when no availability records are found.
offsetNoNumber of matching datasets skipped for this page.
datasetsNoAvailable datasets matching the query.
truncatedNoWhether this page contains only part of the matching dataset list.
nextOffsetNoOffset for the next page; absent when no rows remain.
totalDatasetsNoTotal number of available dataset records.

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, so the safety profile is covered. The description adds real behavioral context beyond them: publication-lag characteristics and pagination semantics ('Continue with nextOffset using the same filters and limit'). The list of returned fields is partly redundant with the existing output schema, which keeps this from a 5.

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

Conciseness5/5

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

Four dense sentences, front-loaded with the purpose, then the return shape, then the timing rationale, then pagination. No filler or restatement of the name.

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?

For a zero-required-parameter index browser with an output schema and read-only annotations, the description covers purpose, motivation, default page size, and continuation procedure. An agent has everything needed to call it correctly and to chain pages.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so freq, period, reporter_code, classification, limit and offset are already documented, including the 'omit to browse' behavior. The description only restates omission and pagination at a high level, adding little syntax or meaning beyond the schema; baseline 3 applies.

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 specific verb and resource: 'Check which reporter/period/classification combinations have published data'. The framing as a pre-flight index check clearly separates it from the sibling query tools (comtrade_get_trade_flows, comtrade_get_top_partners, etc.).

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 explicit when-to-use guidance ('Call this before querying recent periods') plus the underlying reason (annual data published 3–12 months after reference year, not all countries report every year), and an alternative mode ('Omit filters to browse the availability index'). Nothing is left to inference.

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

comtrade_get_services_tradeGet Services Trade DataA
Read-only
Inspect

Fetch annual international trade-in-services data through the combined EB classification; each row identifies its actual classification edition. Same bilateral structure as goods trade: returns flow value in USD, period, and reporter/partner/category metadata for each row. Use comtrade_list_service_categories to find the right service code before querying. Preview makes one paced request per served period, capped at 500 records per request. Services coverage is more limited than goods trade.

NameRequiredDescriptionDefault
periodYesAnnual periods YYYY. Serves the first 12 and discloses the remainder; input ceiling 120. Preview makes one paced request per period.
flow_codeYesTrade flow: M=imports (debits), X=exports (credits).
partner_codeNoM49 partner code. Use 0 for all partners combined. Omit for a disaggregated by-partner breakdown.
service_codeNoEB service category code (e.g. "SA" for manufacturing services or "3" for transport). Use comtrade_list_service_categories to find available codes. Omit to get totals across all service categories.
reporter_codeYesM49 numeric code of the reporting country (0–999).

Output Schema

NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
shownNoNumber of records returned.
noticeNoRecovery hint when no records are returned.
recordsNoServices trade flow records.
truncatedNoTrue when any preview response reached 500 and may be incomplete.
totalCountNoSum of upstream response counts before local filtering; not a full match count when capped.
truncationHintNoQuery narrowing and authenticated access guidance when possibly incomplete.
referenceNoticeNoReference descriptions unavailable; codes and values retained.
unservedPeriodsNoPeriods beyond the 12-period work cap; query them separately.

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds real value with the preview behavior: one paced request per served period, 500-record cap per request. It says less about pagination beyond the cap, error behavior, or how 'disclosed remainder' periods are handled.

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?

Front-loaded with the core action and classification detail, then the category-lookup routing, then a workload warning. Nearly every sentence earns its place, though listing the returned fields (flow value in USD, period, reporter/partner/category metadata) is largely redundant when an output schema exists.

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?

Given annotations, a full-coverage schema, and an output schema, the description covers the main agent-relevant extras: classification editions, category lookup prerequisite, per-period request pacing and 500-record cap, and limited services coverage. It leaves only minor gaps such as behavior when a reporter lacks services data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter is already documented in the schema. The description reinforces the service_code lookup workflow and the per-period request cost but adds no syntax or edge-case meaning beyond the schema. Baseline 3 applies.

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 specific verb and resource ('Fetch annual international trade-in-services data') plus the classification scheme (combined EB) and the fact that each row carries its actual edition. It also implicitly contrasts with the goods trade tool by noting the 'same bilateral structure as goods trade,' so an agent can tell it apart from comtrade_get_trade_flows.

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

Usage Guidelines4/5

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

Gives a concrete prerequisite: use comtrade_list_service_categories to resolve the service code before querying. It also warns that services coverage is narrower than goods, which sets expectations. It stops short of saying when to prefer this over the general goods flow tool or what to do when a reporter has no services data.

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

comtrade_get_top_commoditiesGet Top Trade CommoditiesA
Read-only
Inspect

Rank HS chapters (2-digit) or headings (4-digit) by trade value for one reporter, flow, and annual or monthly period. Retrieves matching TOTAL and the reporter’s HS edition, then queries explicit commodity codes in chunks; capped chunks are subdivided. Shares use matching TOTAL. Incomplete coverage returns available categories without ranks or shares and identifies unresolved codes. Defaults to World; optionally select one bilateral partner. Counterpart to comtrade_get_top_partners.

NameRequiredDescriptionDefault
limitNoMaximum number of top commodity categories to return; above 50 returns all retrieved categories.
periodYesSingle period: annual (YYYY) or monthly (YYYYMM, month 01–12).
flow_codeYesTrade flow: M=imports, X=exports.
aggr_levelNoHS aggregation level: 2 = chapter (broader), 4 = heading (more specific).
partner_codeNoM49 partner code for a bilateral relationship; omit for World aggregate (0).
reporter_codeYesM49 numeric code of the reporting country.

Output Schema

NameRequiredDescription
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 complete commodity-code coverage could not be established.
commoditiesNoTop commodity categories sorted by descending trade value.
missingCodesNoCodes whose retrieval failed or remained capped; empty when the code universe is unavailable.
reporterCodeNoM49 reporter code.
reporterDescNoReporter country name.
totalValueUsdNoSum of primary values across all returned categories (before limit).
coverageNoticeNoExplanation of coverage and ranking availability.
coverageCompleteNoWhether every code in the matching HS edition was queried without a capped response.
totalCommoditiesNoTotal commodity categories returned by API.
classificationCodeNoHS edition identified by matching TOTAL.
denominatorValueUsdNoMatching TOTAL value used as the share denominator, separate from the retrieved-category sum.

TDQS

A4.4/5.0
Behavior4/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description discloses meaningful internals: matching TOTAL retrieval, chunked code queries, subdivision of capped chunks, and shares computed from the matching TOTAL. It also discloses degraded behavior (unranked categories and unresolved codes on incomplete coverage). Minor gap: no indication of failure or rate-limit behavior for the multi-chunk fan-out.

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?

The primary action is front-loaded in sentence one and each subsequent sentence adds distinct operational detail. It is dense to the point of being terse in the middle clauses, but no sentence is redundant filler.

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?

For a tool with 6 parameters, partial-coverage risk, and chunked retrieval, the description covers inputs, ranking semantics, and partial-result behavior; the output schema carries return shape, so nothing essential is missing. An agent can call it correctly and interpret degraded responses from the description alone.

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 adds value by clarifying that reporter, flow, and period define a single ranking context and that omitting the bilateral reporter selects World. The limit/truncation interaction with chunking is also implied by the coverage caveat, though the exact threshold lives only in the schema.

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?

The first sentence states a specific verb (rank), resource (HS chapters/headings), and scope (one reporter, flow, and annual or monthly period). Naming comtrade_get_top_partners as the counterpart lets an agent separate this tool from its closest sibling without opening either schema.

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

Usage Guidelines4/5

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

Usage context is clear: default to World unless a single bilateral partner is supplied, and the counterpart pointer implicitly routes partner-level ranking to comtrade_get_top_partners. It stops short of explicit when-not guidance against the other siblings such as comtrade_search_commodities, so it is not a 5.

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

comtrade_get_top_partnersGet Top Trading PartnersA
Read-only
Inspect

Rank trading partners for a reporter by trade value for a given commodity and flow direction. Returns the top N partners sorted by descending value — answers "who does country X mainly export product Y to?" or "where does country X mainly import product Z from?" for a single period. Fetches a disaggregated breakdown across all partners then sorts locally. Omit cmd_code to rank partners for total trade.

NameRequiredDescriptionDefault
limitNoMaximum number of top partners to return; above 50 returns all retrieved partners.
periodYesSingle period: annual YYYY or monthly YYYYMM, month 01–12; frequency is inferred.
cmd_codeNoSingle HS commodity code (e.g. "84", "8471"). Omit or pass "TOTAL" to rank partners for total merchandise trade.
flow_codeYesTrade flow: M=imports, X=exports.
reporter_codeYesM49 numeric code of the reporting country (0–999).

Output Schema

NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
noticeNoRecovery hint when no data is returned.
periodNoPeriod queried.
cmdCodeNoCommodity code queried (TOTAL when omitted).
flowCodeNoFlow direction queried.
partnersNoTop partners sorted by descending trade value.
truncatedNoTrue when API returned 500 records and results may be incomplete.
reporterCodeNoM49 reporter code.
reporterDescNoReporter country name.
totalPartnersNoTotal partners with non-zero trade value returned by API.
totalValueUsdNoSum of primary values across all returned partners (before limit truncation).
referenceNoticeNoReference descriptions unavailable; codes and values retained.

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, so the safety profile is covered. The description adds genuinely useful behavior beyond them: it fetches a disaggregated breakdown across all partners and sorts locally, which warns about data volume and implies the limit is applied client-side. It stops short of stating rate limits or what happens when no partners exist.

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

Conciseness5/5

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

Three sentences, front-loaded with the action and purpose, then the concrete question framing, then the execution note. No filler and nothing important buried.

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?

An output schema exists so return values need no explanation, and all five parameters are schema-documented at full coverage. The only meaningful gap is that it does not clarify how ties or missing partner data are handled, which for a ranking tool is a minor omission.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both the limit and cmd_code semantics ('Omit or pass TOTAL') are already fully documented in the schema. The description's 'top N' and 'Omit cmd_code' remarks largely restate that, adding little meaning beyond structured fields. Baseline 3 applies.

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 specific verb (rank) and resource (trading partners) with the scoping dimensions (reporter, commodity, flow), and the two quoted example questions make the output shape unambiguous. It is clearly distinguished from sibling comtrade_get_top_commodities, which does the inverse ranking.

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

Usage Guidelines4/5

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

Usage context is clear: single-period ranking, and 'Omit cmd_code to rank partners for total trade' gives a concrete decision rule. However, no sibling is named as an alternative, so an agent comparing this against comtrade_get_trade_flows or comtrade_get_top_commodities must infer the routing itself.

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

comtrade_get_trade_balanceGet Trade BalanceA
Read-only
Inspect

Compute the trade balance for a country over one or more periods — total exports minus total imports — with optional HS or SITC commodity filter. Preview makes two paced requests per served period; authenticated calls batch periods. Returns the signed balance (USD), export value, import value, and coverage ratio (exports / imports). Note: mirror asymmetry is common — balance reflects values as reported by this country; the same flow may be recorded differently by the partner. Uses comtrade_lookup_countries to resolve reporter codes.

NameRequiredDescriptionDefault
freqNoFrequency: A=annual YYYY, M=monthly YYYYMM (01–12).A
periodYesAnnual periods (YYYY) or monthly periods (YYYYMM). Serves the first 12 and discloses the remainder; input ceiling 120.
cmd_codeNoHS or SITC commodity codes to restrict the balance calculation. Serves the first 20 and discloses the remainder; input ceiling 200. Omit to compute the overall trade balance across all commodities.
partner_codeNoM49 partner code (0–999); defaults to World (0). The balance uses the reporter’s values.
reporter_codeYesM49 numeric code of the reporting country (0–999).
classificationNoGoods classification: HS/H0–H6 or SITC S1–S4/SS.HS

Output Schema

NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
noticeNoPossible incompleteness of the balance when a preview response reaches its cap.
periodsNoBalance computation per period.
cmdCodesNoCommodity codes used in the query (absent when querying all commodities).
partnerCodeNoM49 partner code used.
partnerDescNoPartner name supplied by the returned records, or its numeric code when unavailable.
mirrorCaveatNoStandard caveat about mirror asymmetry — balance reflects this country's reported values.
reporterCodeNoM49 reporter code used.
reporterDescNoReporter country name.
referenceNoticeNoReference descriptions unavailable; codes and trade values retained.
unservedPeriodsNoPeriods beyond the 12-period work cap; query them separately.
unservedCmdCodesNoCommodity codes beyond the 20-code work cap; query them separately.

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the readOnlyHint/openWorldHint annotations by disclosing the request cost model ('preview makes two paced requests per served period; authenticated calls batch periods') and the truncation behavior for periods and commodity codes. It also flags the mirror-asymmetry caveat that the balance reflects only the reporter's own values, which is a substantive data-quality warning an agent could not infer from structured fields.

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?

Front-loaded with the computation and formula, then progressively adds cost model, return shape, and caveat. It is dense with four long sentences but nearly every clause carries operational value; the enumerated return fields are the only part that mildly duplicates the output schema.

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?

Given a six-parameter tool with a full input schema, an output schema, and safety annotations, the description covers the remaining gaps: request cost, batching, truncation, return composition, and the mirror-asymmetry interpretation risk. Nothing an agent needs to call or interpret the result correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter is already documented with defaults and formats. The description adds only a light gloss on the commodity filter and reporter-code resolution, which is the expected baseline when the schema does the heavy lifting.

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 specific verb and resource ('Compute the trade balance for a country over one or more periods') and defines the metric inline ('total exports minus total imports'), which distinguishes it from the raw-flow sibling comtrade_get_trade_flows. The optional commodity filter scope is also named.

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

Usage Guidelines4/5

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

Implies the correct usage context via the commodity-filter option and explicitly points to comtrade_lookup_countries for resolving reporter codes. It does not explicitly state when to prefer this over comtrade_get_trade_flows or comtrade_get_top_partners, so the routing guidance is inferred rather than stated.

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

comtrade_get_trade_flowsGet Trade Flow RecordsA
Read-only
Inspect

Fetch bilateral trade flow records — the primary data retrieval tool. Returns trade value in USD (primaryValue — FOB for exports, CIF for imports), quantity, net weight, and period/commodity/partner metadata for each row. Accepts multiple periods and commodity codes per call; pass partner_code 0 to get totals aggregated across all partners. Omit cmd_code or pass "TOTAL" to aggregate all commodities. Preview makes one paced request per served period, with a 500-record cap per request. Use comtrade_lookup_countries to resolve reporter/partner codes and comtrade_search_commodities to resolve HS codes. For SITC, supply codes from the selected SITC revision.

NameRequiredDescriptionDefault
freqNoFrequency: A=annual YYYY, M=monthly YYYYMM (01–12).A
periodYesOne or more periods to query. Annual: "YYYY" (e.g. ["2022", "2023"]). Monthly: "YYYYMM" (e.g. ["202201", "202202"]). Serves the first 12 periods and discloses the remainder; input ceiling 120.
cmd_codeNoHS or SITC commodity codes to query. Serves the first 20 codes and discloses the remainder; input ceiling 200. Pass ["TOTAL"] or omit to aggregate all commodities. Use comtrade_search_commodities for codes in the selected HS or SITC edition.
flow_codeYesTrade flow direction: M=imports, X=exports, RX=re-exports, RM=re-imports.
partner_codeNoM49 code of the trade partner. Use 0 to aggregate across all partners (World total). Omit to get a disaggregated breakdown by partner country.
reporter_codeNoM49 reporter code or nonempty array (input ceiling 200). Deduplicates and serves the first 20 reporters, disclosing the remainder. Omit only with an explicit partner_code to query all reporters.
classificationNoGoods classification: HS as reported, H0–H6 with authenticated access, or SITC S1–S4/SS.HS

Output Schema

NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
shownNoNumber of records returned in this response.
noticeNoRecovery hint when no records are returned. Absent on successful responses.
recordsNoTrade flow records.
truncatedNoTrue when any preview response reached 500 and may be incomplete.
totalCountNoSum of upstream response counts before local filtering; not a full match count when capped.
truncationHintNoQuery narrowing and authenticated access guidance when possibly incomplete.
referenceNoticeNoNotice when reference descriptions could not be loaded; codes and trade values remain available.
unservedPeriodsNoPeriods beyond the 12-period work cap; query them separately.
unservedCmdCodesNoCommodity codes beyond the 20-code work cap; query them separately.
unservedReportersNoReporter codes beyond the 20-reporter work cap; query them separately.

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, yet the description adds substantive behavior: return fields and their valuation basis (FOB for exports, CIF for imports), the paced one-request-per-period pattern in Preview mode, and a 500-record cap per request. The truncation behavior (first 12 periods, first 20 codes, first 20 reporters with the remainder disclosed) is also surfaced rather than left buried in the schema.

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?

The description is front-loaded with purpose and return shape before moving into calling conventions and helper tools, and each sentence carries information. There is minor redundancy, such as restating that multiple periods and commodity codes can be accepted per call, which the array schema already conveys.

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 7-parameter, open-world retrieval tool with an output schema, this is close to complete: it covers aggregation semantics, code resolution, classification caveats, and request pacing limits. The remaining gap is the unexplained 'Preview' mode and the cap/truncation interplay across parameters, which an agent may still misjudge in combination.

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 a baseline of 3 applies, but the description adds real meaning on top: the FOB/CIF interpretation of primaryValue, the World-total shortcut of partner_code 0, the disaggregated default when partner_code is omitted, and the TOTAL/omit convention for cmd_code. It does not clarify the freq defaults or the 'Preview' notion that has no corresponding schema parameter, which keeps it short of a 5.

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 (fetch bilateral trade flow records) and frames it as the primary data retrieval tool, which pairs well with the read-only annotations. It does not explicitly contrast itself with the closest siblings that could be confused with it (comtrade_get_services_trade, comtrade_get_top_commodities), so the agent must infer that this tool covers goods flows rather than services or rankings.

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

Usage Guidelines4/5

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

It gives concrete operational guidance: pass partner_code 0 to aggregate across all partners, omit cmd_code or pass TOTAL to aggregate commodities, and use comtrade_lookup_countries and comtrade_search_commodities to resolve codes before calling. It also notes the SITC revision dependency. What's missing is an explicit when-not clause or a direct pointer to the services/rankings siblings for those use cases.

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

comtrade_list_service_categoriesList Service Trade Categories (EB)A
Read-only
Inspect

List service trade categories from the combined EB catalog, including numeric EBOPS and SDMX codes. Returns category codes, descriptions, and parent codes. Filter by keyword (e.g. "transport", "financial", "travel") or browse direct children of a parent code. Use the returned id as service_code in comtrade_get_services_trade. Code 3 is transport; SA is manufacturing services.

NameRequiredDescriptionDefault
limitNoMaximum number of categories to return; above 500 returns all matching categories.
queryNoKeyword or category code prefix to filter results. Examples: "transport", "SA", "financial services". Omit to list all EB categories.
parent_codeNoReturn direct children of this EB category code. Example: "3" for transport sub-categories, or "3.1" for sea transport sub-categories.

Output Schema

NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
shownNoNumber of categories returned.
noticeNoRecovery hint when no results found or results are truncated.
truncatedNoTrue when categories were capped at the limit (totalMatches exceeds shown).
categoriesNoEB service categories matching the query.
totalMatchesNoTotal matching categories before limit truncation.

TDQS

A4.1/5.0
Behavior4/5

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

The readOnlyHint/openWorldHint annotations already establish a safe, local read, so the description only needs to add context — which it does by disclosing the catalog's provenance (combined EB), the returned fields (codes, descriptions, parent codes), and domain anchors like "Code 3 is transport; SA is manufacturing services." It does not discuss exhaustiveness or whether the catalog is static, a minor remaining gap for a lookup tool.

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?

The definition is front-loaded with purpose, then filtering behavior, then the downstream handoff — a sensible order with no filler sentences. A small amount of space is spent repeating limit/query behavior already covered by the schema.

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 three-optional-parameter, read-only catalog tool with a 100%-covered schema and an output schema, this is nearly complete: usage modes, downstream linkage, and code semantics are all present. Return-value explanation is slightly redundant given the output schema, and catalog exhaustiveness remains unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so limit, query, and parent_code are already fully documented; the description's filter/browse sentences largely restate those schema descriptions. The one piece of genuinely added meaning is the mapping of a returned id to the service_code parameter of comtrade_get_services_trade, which the schema cannot express.

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?

"List service trade categories from the combined EB catalog" gives a specific verb and resource, and the mention of numeric EBOPS and SDMX codes plus keyword/parent filtering separates it cleanly from siblings like comtrade_search_commodities and comtrade_lookup_countries.

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

Usage Guidelines4/5

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

It states the two usage modes (keyword filter vs. browsing direct children of a parent code) and explicitly routes the agent onward: "Use the returned id as service_code in comtrade_get_services_trade." It stops short of an explicit exclusion naming comtrade_search_commodities as the alternative for commodity lookups.

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

comtrade_lookup_countriesLookup Countries / AreasA
Read-only
Inspect

Resolve country and area names to Comtrade M49 numeric codes used in all data queries. Accepts a partial name, full name, or ISO alpha-2/alpha-3 code (e.g. "United States", "USA", "US"). Returns matching entries with their numeric code, ISO identifiers, and a validAsReporter flag — regional groupings like "World" (code 0) are valid partners but not valid reporters. Use this before any trade data tool that requires reporter_code or partner_code. To aggregate across all partners, use partner code 0 (World) — no lookup needed.

NameRequiredDescriptionDefault
roleNoFilter by role: "reporter" returns only codes valid for the reporterCode parameter, "partner" returns only partner areas (includes regional groupings), "any" returns all matches regardless of role.any
queryYesCountry or area name fragment, full name, or ISO alpha-2/alpha-3 code to search for. Case-insensitive. Examples: "Germany", "DEU", "DE", "united states", "china".
include_groupsNoWhether to include regional and economic groupings (e.g. EU, ASEAN). Set to false to return only individual countries.

Output Schema

NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
noticeNoRecovery hint when no matches are found — echoes the query and suggests alternatives. Absent when results are non-empty.
matchesNoMatching entries ordered by exact ISO identity, reporter validity, then name.
totalMatchesNoTotal number of matching entries.

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and an output schema exists, so the bar is lower. The description's genuinely additive piece is the domain semantics of validAsReporter — regional groupings such as 'World' (code 0) are valid partners but not valid reporters — which warns the agent off a plausible misuse; the rest largely restates the return payload and the schema's case-insensitivity.

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

Conciseness5/5

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

Four short sentences, front-loaded with the core action and then the invocation prerequisite. Every sentence carries information an agent needs: input forms, return fields, the validAsReporter caveat, and the partner-0 shortcut.

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?

The tool is simple, the schema is fully documented, and an output schema covers return values, so the description only needed to add the sequencing rule and the reporter/partner distinction — it does both. Nothing required to call this correctly before a trade-data call is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, including an inline enum explanation for `role` and a documented default for `include_groups`, so the baseline is 3. The description reinforces input flexibility and adds the aggregation shortcut (partner code 0), but it does not explain how `role` and `include_groups` interact or what happens with an ambiguous partial name.

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 specific verb and resource: 'Resolve country and area names to Comtrade M49 numeric codes used in all data queries.' It also names the accepted input forms and the returned fields, so an agent can distinguish this pure-lookup tool from every sibling data-retrieval tool without opening a 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?

Explicitly routes usage: 'Use this before any trade data tool that requires reporter_code or partner_code,' and gives an exclusion — aggregation across all partners needs no lookup, just partner code 0. Both the when and the when-not are stated.

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

comtrade_search_commoditiesSearch Commodity CodesA
Read-only
Inspect

Find HS or SITC commodity codes by keyword, partial description, or code prefix in the selected classification. Returns descriptions, native aggregation levels, parents, leaf status, and recommendedQueryCode for subsequent trade queries. HS uses levels 2 (chapter), 4 (heading), and 6 (subheading); SITC uses levels 1–5. Select the edition matching the trade records when interpreting historical codes.

NameRequiredDescriptionDefault
limitNoMaximum number of results to return; above 200 returns all matching codes.
queryYesKeyword, partial description, or commodity code prefix. Examples: "motor vehicles", "8471", "coffee", "84" (HS chapter 84 = machinery).
aggr_levelNoNative aggregation level: HS uses 2 (chapter), 4 (heading), 6 (subheading); SITC uses 1–5. Omit to return all matching levels.
classificationNoGoods reference catalog: HS uses the default HS.json discovery catalog, whose total identifies H6; it is not an authoritative historical-edition reference. Select H0–H6 for an explicit HS edition, or SS/S1–S4 for SITC.HS

Output Schema

NameRequiredDescription
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.
matchesNoCommodity codes matching the query in the selected classification.
truncatedNoTrue when matches were capped at the limit (totalMatches exceeds shown).
totalMatchesNoTotal matching codes (before limit truncation).
classificationNoReference catalog used for the search.

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds genuinely new context: the caveat that the default HS catalog is a discovery catalog rather than an authoritative historical-edition reference, and the hierarchy/leaf-status semantics that shape interpretation of results.

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?

Three tight sentences with the core capability front-loaded and the caveat placed last where it belongs. Some content (the HS 2/4/6 and SITC 1–5 level mapping) duplicates the schema verbatim and could be trimmed.

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?

With an output schema present and full parameter documentation, the description need not explain return values, and it correctly focuses on classification-edition semantics. It could go one step further by stating the explicit handoff to comtrade_get_trade_flows using recommendedQueryCode, but nothing essential for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all four parameters, including the aggr_level level mapping and the classification enum caveats. The description restates the level scheme and adds only the edition-matching heuristic, so it adds marginal meaning beyond structured fields.

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 specific verb and resource ("Find HS or SITC commodity codes") plus the three search modes (keyword, partial description, code prefix) and the scoping constraint ("in the selected classification"). This is clearly distinguishable from siblings like comtrade_lookup_countries or comtrade_get_top_commodities.

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

Usage Guidelines4/5

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

Implies the workflow position by noting it returns "recommendedQueryCode for subsequent trade queries," and gives edition-selection guidance ("Select the edition matching the trade records when interpreting historical codes"). It stops short of explicit when-not guidance or naming a specific sibling as an alternative.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 9 tool updates
    • Changedcomtrade_get_data_availability16 fields changed
      • addedInput schema / properties / classification / allOf
        Added value: +[
        +  {
        +    "pattern": "^(?:[A-Z0-9]+(?:\\.[A-Z0-9]+)*)?$"
        +  },
        +  {
        +    "pattern": "^(?:[A-Z][A-Z0-9]*)?$"
        +  }
        +]
      • changedInput schema / properties / freq / description
        Previous value: -"Frequency: A=annual, M=monthly."New value: +"Frequency: A=annual YYYY, M=monthly YYYYMM (01–12)."
      • removedInput schema / properties / freq / enum
        Removed value: -[
        -  "A",
        -  "M"
        -]
      • addedInput schema / properties / limit
        Added value: +{
        +  "default": 50,
        +  "description": "Maximum datasets returned per page; defaults to 50.",
        +  "exclusiveMinimum": 0,
        +  "maximum": 9007199254740991,
        +  "type": "integer"
        +}
      • addedInput schema / properties / offset
        Added value: +{
        +  "default": 0,
        +  "description": "Number of matching datasets to skip; use nextOffset to continue.",
        +  "maximum": 9007199254740991,
        +  "minimum": 0,
        +  "type": "integer"
        +}
      • addedInput schema / properties / period / pattern
        Added value: +"^[0-9]{4}(?:0[1-9]|1[0-2])?$"
      • changedInput schema / properties / reporter_code / maximum
        Previous value: -9007199254740991New value: +999
      • changedInput schema / properties / reporter_code / minimum
        Previous value: --9007199254740991New value: +0
      • removedInput schema / properties / type_code / enum
        Removed value: -[
        -  "C",
        -  "S"
        -]
      • changedOutput schema / anyOf
        Previous value: -[
        -  {
        -    "not": {
        -      "required": [
        -        "error"
        -      ]
        -    },
        -    "required": [
        -      "datasets",
        -      "totalDatasets"
        -    ]
        -  },
        -  {
        -    "required": [
        -      "error"
        -    ]
        -  }
        -]New value: +[
        +  {
        +    "not": {
        +      "required": [
        +        "error"
        +      ]
        +    },
        +    "required": [
        +      "datasets",
        +      "totalDatasets",
        +      "truncated",
        +      "offset",
        +      "shown"
        +    ]
        +  },
        +  {
        +    "required": [
        +      "error"
        +    ]
        +  }
        +]
      • changedOutput schema / properties / error / properties / data / properties / reason / description
        Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `upstream_validation`: UN Comtrade rejects the availability query dimensions. `invalid_upstream_response`: UN Comtrade returns malformed availability data. Other values are possible when a failure originates below the handler."
      • addedOutput schema / properties / error / properties / data / properties / reason / examples
        Added value: +[
        +  "upstream_validation",
        +  "invalid_upstream_response"
        +]
      • addedOutput schema / properties / nextOffset
        Added value: +{
        +  "description": "Offset for the next page; absent when no rows remain.",
        +  "type": "number"
        +}
      • addedOutput schema / properties / offset
        Added value: +{
        +  "description": "Number of matching datasets skipped for this page.",
        +  "type": "number"
        +}
      • addedOutput schema / properties / shown
        Added value: +{
        +  "description": "Number of datasets returned on this page.",
        +  "type": "number"
        +}
      • addedOutput schema / properties / truncated
        Added value: +{
        +  "description": "Whether this page contains only part of the matching dataset list.",
        +  "type": "boolean"
        +}
    • Changedcomtrade_get_services_trade18 fields changed
      • changedInput schema / properties / flow_code / description
        Previous value: -"Trade flow: M=imports (credit received by reporter), X=exports (debit paid)."New value: +"Trade flow: M=imports (debits), X=exports (credits)."
      • removedInput schema / properties / flow_code / enum
        Removed value: -[
        -  "M",
        -  "X"
        -]
      • changedInput schema / properties / partner_code / maximum
        Previous value: -9007199254740991New value: +999
      • changedInput schema / properties / partner_code / minimum
        Previous value: --9007199254740991New value: +0
      • changedInput schema / properties / period / description
        Previous value: -"Periods (YYYY or YYYYMM). Serves the first 12 and discloses the remainder; input ceiling 120. Preview makes one paced request per period."New value: +"Annual periods YYYY. Serves the first 12 and discloses the remainder; input ceiling 120. Preview makes one paced request per period."
      • removedInput schema / properties / period / items / minLength
        Removed value: -4
      • addedInput schema / properties / period / items / pattern
        Added value: +"^[0-9]{4}$"
      • changedInput schema / properties / reporter_code / description
        Previous value: -"M49 numeric code of the reporting country."New value: +"M49 numeric code of the reporting country (0–999)."
      • changedInput schema / properties / reporter_code / maximum
        Previous value: -9007199254740991New value: +999
      • changedInput schema / properties / reporter_code / minimum
        Previous value: --9007199254740991New value: +0
      • changedInput schema / properties / service_code / description
        Previous value: -"EBOPS 2010 service category code (e.g. \"SA\" for transport). Use comtrade_list_service_categories to find available codes. Omit to get totals across all service categories."New value: +"EB service category code (e.g. \"SA\" for manufacturing services or \"3\" for transport). Use comtrade_list_service_categories to find available codes. Omit to get totals across all service categories."
      • addedInput schema / properties / service_code / pattern
        Added value: +"^(?:[A-Z0-9]+(?:\\.[A-Z0-9]+)*)?$"
      • changedOutput schema / properties / error / properties / data / properties / reason / description
        Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_reporter_filter`: Reporter omission lacks an explicit partner. `upstream_validation`: UN Comtrade rejects the query dimensions. `invalid_upstream_response`: UN Comtrade returns malformed services data. Other values are possible when a failure originates below the handler."
      • addedOutput schema / properties / error / properties / data / properties / reason / examples
        Added value: +[
        +  "invalid_reporter_filter",
        +  "upstream_validation",
        +  "invalid_upstream_response"
        +]
      • addedOutput schema / properties / records / items / properties / classificationCode
        Added value: +{
        +  "description": "Actual services classification edition on the returned row.",
        +  "type": "string"
        +}
      • changedOutput schema / properties / records / items / properties / flowCode / description
        Previous value: -"Trade flow: M=import (credit received), X=export (debit paid)."New value: +"Trade flow: M=imports (debits), X=exports (credits)."
      • changedOutput schema / properties / records / items / properties / period / description
        Previous value: -"Period (YYYY or YYYYMM)."New value: +"Annual period YYYY."
      • addedOutput schema / properties / referenceNotice
        Added value: +{
        +  "description": "Reference descriptions unavailable; codes and values retained.",
        +  "type": "string"
        +}
    • Changedcomtrade_get_top_commodities17 fields changed
      • removedInput schema / properties / flow_code / enum
        Removed value: -[
        -  "M",
        -  "X"
        -]
      • changedInput schema / properties / partner_code / description
        Previous value: -"M49 partner code to filter to a specific bilateral relationship. Omit to rank commodities across all partners."New value: +"M49 partner code for a bilateral relationship; omit for World aggregate (0)."
      • changedInput schema / properties / period / description
        Previous value: -"Single period: annual (YYYY) or monthly (YYYYMM)."New value: +"Single period: annual (YYYY) or monthly (YYYYMM, month 01–12)."
      • removedInput schema / properties / period / minLength
        Removed value: -4
      • addedInput schema / properties / period / pattern
        Added value: +"^[0-9]{4}(?:0[1-9]|1[0-2])?$"
      • changedOutput schema / anyOf
        Previous value: -[
        -  {
        -    "not": {
        -      "required": [
        -        "error"
        -      ]
        -    },
        -    "required": [
        -      "commodities",
        -      "reporterCode",
        -      "reporterDesc",
        -      "period",
        -      "flowCode",
        -      "aggrLevel",
        -      "totalCommodities",
        -      "truncated"
        -    ]
        -  },
        -  {
        -    "required": [
        -      "error"
        -    ]
        -  }
        -]New value: +[
        +  {
        +    "not": {
        +      "required": [
        +        "error"
        +      ]
        +    },
        +    "required": [
        +      "commodities",
        +      "reporterCode",
        +      "reporterDesc",
        +      "period",
        +      "flowCode",
        +      "aggrLevel",
        +      "totalCommodities",
        +      "truncated",
        +      "coverageComplete",
        +      "coverageNotice",
        +      "missingCodes"
        +    ]
        +  },
        +  {
        +    "required": [
        +      "error"
        +    ]
        +  }
        +]
      • addedOutput schema / properties / classificationCode
        Added value: +{
        +  "description": "HS edition identified by matching TOTAL.",
        +  "type": "string"
        +}
      • changedOutput schema / properties / commodities / items / properties / rank / description
        Previous value: -"Rank (1 = largest trade value)."New value: +"Rank (1 = largest trade value), only with complete code coverage and known values."
      • changedOutput schema / properties / commodities / items / properties / sharePercent / description
        Previous value: -"Share of total trade value among returned commodities, as a percentage."New value: +"Share of matching TOTAL trade value, only with complete code coverage."
      • changedOutput schema / properties / commodities / items / required
        Previous value: -[
        -  "rank",
        -  "cmdCode",
        -  "cmdDesc",
        -  "aggrLevel"
        -]New value: +[
        +  "cmdCode",
        +  "cmdDesc",
        +  "aggrLevel"
        +]
      • addedOutput schema / properties / coverageComplete
        Added value: +{
        +  "description": "Whether every code in the matching HS edition was queried without a capped response.",
        +  "type": "boolean"
        +}
      • addedOutput schema / properties / coverageNotice
        Added value: +{
        +  "description": "Explanation of coverage and ranking availability.",
        +  "type": "string"
        +}
      • addedOutput schema / properties / denominatorValueUsd
        Added value: +{
        +  "description": "Matching TOTAL value used as the share denominator, separate from the retrieved-category sum.",
        +  "type": "number"
        +}
      • changedOutput schema / properties / error / properties / data / properties / reason / description
        Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `keyless_hs_edition_unsupported`: An explicit HS edition requires authenticated access. `upstream_validation`: UN Comtrade rejects the supplied query dimensions. `invalid_upstream_response`: UN Comtrade returns a malformed response. `invalid_reporter_filter`: The query omits required reporter filtering. Other values are possible when a failure originates below the handler."
      • addedOutput schema / properties / error / properties / data / properties / reason / examples
        Added value: +[
        +  "keyless_hs_edition_unsupported",
        +  "upstream_validation",
        +  "invalid_upstream_response",
        +  "invalid_reporter_filter"
        +]
      • addedOutput schema / properties / missingCodes
        Added value: +{
        +  "description": "Codes whose retrieval failed or remained capped; empty when the code universe is unavailable.",
        +  "items": {
        +    "type": "string"
        +  },
        +  "type": "array"
        +}
      • changedOutput schema / properties / truncated / description
        Previous value: -"True when API returned 500 records and results may be incomplete."New value: +"True when complete commodity-code coverage could not be established."
    • Changedcomtrade_get_top_partners11 fields changed
      • addedInput schema / properties / cmd_code / pattern
        Added value: +"^(?:[A-Z0-9]+(?:\\.[A-Z0-9]+)*)?$"
      • removedInput schema / properties / flow_code / enum
        Removed value: -[
        -  "M",
        -  "X"
        -]
      • changedInput schema / properties / period / description
        Previous value: -"Single period: annual (YYYY) or monthly (YYYYMM)."New value: +"Single period: annual YYYY or monthly YYYYMM, month 01–12; frequency is inferred."
      • removedInput schema / properties / period / minLength
        Removed value: -4
      • addedInput schema / properties / period / pattern
        Added value: +"^[0-9]{4}(?:0[1-9]|1[0-2])?$"
      • changedInput schema / properties / reporter_code / description
        Previous value: -"M49 numeric code of the reporting country."New value: +"M49 numeric code of the reporting country (0–999)."
      • changedInput schema / properties / reporter_code / maximum
        Previous value: -9007199254740991New value: +999
      • changedInput schema / properties / reporter_code / minimum
        Previous value: --9007199254740991New value: +0
      • changedOutput schema / properties / error / properties / data / properties / reason / description
        Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_reporter_filter`: Reporter omission lacks an explicit partner. `upstream_validation`: UN Comtrade rejects the query dimensions. `invalid_upstream_response`: UN Comtrade returns malformed trade data. Other values are possible when a failure originates below the handler."
      • addedOutput schema / properties / error / properties / data / properties / reason / examples
        Added value: +[
        +  "invalid_reporter_filter",
        +  "upstream_validation",
        +  "invalid_upstream_response"
        +]
      • addedOutput schema / properties / referenceNotice
        Added value: +{
        +  "description": "Reference descriptions unavailable; codes and values retained.",
        +  "type": "string"
        +}
    • Changedcomtrade_get_trade_balance15 fields changed
      • removedInput schema / properties / classification / enum
        Removed value: -[
        -  "HS",
        -  "H0",
        -  "H1",
        -  "H2",
        -  "H3",
        -  "H4",
        -  "H5",
        -  "H6",
        -  "S1",
        -  "S2",
        -  "S3",
        -  "S4",
        -  "SS"
        -]
      • addedInput schema / properties / cmd_code / items / pattern
        Added value: +"^(?:[A-Z0-9]+(?:\\.[A-Z0-9]+)*)?$"
      • changedInput schema / properties / freq / description
        Previous value: -"Frequency: A=annual, M=monthly."New value: +"Frequency: A=annual YYYY, M=monthly YYYYMM (01–12)."
      • removedInput schema / properties / freq / enum
        Removed value: -[
        -  "A",
        -  "M"
        -]
      • addedInput schema / properties / partner_code
        Added value: +{
        +  "default": 0,
        +  "description": "M49 partner code (0–999); defaults to World (0). The balance uses the reporter’s values.",
        +  "maximum": 999,
        +  "minimum": 0,
        +  "type": "integer"
        +}
      • removedInput schema / properties / period / items / minLength
        Removed value: -4
      • addedInput schema / properties / period / items / pattern
        Added value: +"^[0-9]{4}(?:0[1-9]|1[0-2])?$"
      • changedInput schema / properties / reporter_code / description
        Previous value: -"M49 numeric code of the reporting country."New value: +"M49 numeric code of the reporting country (0–999)."
      • changedInput schema / properties / reporter_code / maximum
        Previous value: -9007199254740991New value: +999
      • changedInput schema / properties / reporter_code / minimum
        Previous value: --9007199254740991New value: +0
      • changedOutput schema / anyOf
        Previous value: -[
        -  {
        -    "not": {
        -      "required": [
        -        "error"
        -      ]
        -    },
        -    "required": [
        -      "periods",
        -      "reporterCode",
        -      "reporterDesc",
        -      "mirrorCaveat"
        -    ]
        -  },
        -  {
        -    "required": [
        -      "error"
        -    ]
        -  }
        -]New value: +[
        +  {
        +    "not": {
        +      "required": [
        +        "error"
        +      ]
        +    },
        +    "required": [
        +      "periods",
        +      "reporterCode",
        +      "reporterDesc",
        +      "partnerCode",
        +      "partnerDesc",
        +      "mirrorCaveat"
        +    ]
        +  },
        +  {
        +    "required": [
        +      "error"
        +    ]
        +  }
        +]
      • changedOutput schema / properties / error / properties / data / properties / reason / description
        Previous value: -"Machine-readable failure mode. Declared by this tool: `no_data`: No trade data available for the reporter and period combination. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `keyless_hs_edition_unsupported`: Explicit HS editions require authenticated data access. `invalid_reporter_filter`: Reporter omission lacks an explicit partner. `upstream_validation`: UN Comtrade rejects the query dimensions. `invalid_upstream_response`: UN Comtrade returns malformed trade data. `no_data`: No trade data available for the reporter and period combination. Other values are possible when a failure originates below the handler."
      • changedOutput schema / properties / error / properties / data / properties / reason / examples
        Previous value: -[
        -  "no_data"
        -]New value: +[
        +  "keyless_hs_edition_unsupported",
        +  "invalid_reporter_filter",
        +  "upstream_validation",
        +  "invalid_upstream_response",
        +  "no_data"
        +]
      • addedOutput schema / properties / partnerCode
        Added value: +{
        +  "description": "M49 partner code used.",
        +  "type": "number"
        +}
      • addedOutput schema / properties / partnerDesc
        Added value: +{
        +  "description": "Partner name supplied by the returned records, or its numeric code when unavailable.",
        +  "type": "string"
        +}
    • Changedcomtrade_get_trade_flows28 fields changed
      • changedInput schema / properties / classification / description
        Previous value: -"Goods classification: HS/H0–H6 or SITC S1–S4/SS. Defaults to combined HS."New value: +"Goods classification: HS as reported, H0–H6 with authenticated access, or SITC S1–S4/SS."
      • removedInput schema / properties / classification / enum
        Removed value: -[
        -  "HS",
        -  "H0",
        -  "H1",
        -  "H2",
        -  "H3",
        -  "H4",
        -  "H5",
        -  "H6",
        -  "S1",
        -  "S2",
        -  "S3",
        -  "S4",
        -  "SS"
        -]
      • changedInput schema / properties / cmd_code / description
        Previous value: -"HS or SITC commodity codes to query. Serves the first 20 codes and discloses the remainder; input ceiling 200. Pass [\"TOTAL\"] or omit to aggregate all commodities. Use comtrade_search_commodities for HS codes only."New value: +"HS or SITC commodity codes to query. Serves the first 20 codes and discloses the remainder; input ceiling 200. Pass [\"TOTAL\"] or omit to aggregate all commodities. Use comtrade_search_commodities for codes in the selected HS or SITC edition."
      • addedInput schema / properties / cmd_code / items / pattern
        Added value: +"^(?:[A-Z0-9]+(?:\\.[A-Z0-9]+)*)?$"
      • removedInput schema / properties / flow_code / enum
        Removed value: -[
        -  "M",
        -  "X",
        -  "RX",
        -  "RM"
        -]
      • changedInput schema / properties / freq / description
        Previous value: -"Frequency: A=annual, M=monthly."New value: +"Frequency: A=annual YYYY, M=monthly YYYYMM (01–12)."
      • removedInput schema / properties / freq / enum
        Removed value: -[
        -  "A",
        -  "M"
        -]
      • changedInput schema / properties / partner_code / maximum
        Previous value: -9007199254740991New value: +999
      • changedInput schema / properties / partner_code / minimum
        Previous value: --9007199254740991New value: +0
      • removedInput schema / properties / period / items / minLength
        Removed value: -4
      • addedInput schema / properties / period / items / pattern
        Added value: +"^[0-9]{4}(?:0[1-9]|1[0-2])?$"
      • addedInput schema / properties / reporter_code / anyOf
        Added value: +[
        +  {
        +    "description": "One M49 reporter code.",
        +    "maximum": 999,
        +    "minimum": 0,
        +    "type": "integer"
        +  },
        +  {
        +    "description": "Reporter codes to query together.",
        +    "items": {
        +      "maximum": 999,
        +      "minimum": 0,
        +      "type": "integer"
        +    },
        +    "maxItems": 200,
        +    "minItems": 1,
        +    "type": "array"
        +  }
        +]
      • changedInput schema / properties / reporter_code / description
        Previous value: -"M49 numeric code of the reporting country. Use comtrade_lookup_countries to resolve names to codes."New value: +"M49 reporter code or nonempty array (input ceiling 200). Deduplicates and serves the first 20 reporters, disclosing the remainder. Omit only with an explicit partner_code to query all reporters."
      • removedInput schema / properties / reporter_code / maximum
        Removed value: -9007199254740991
      • removedInput schema / properties / reporter_code / minimum
        Removed value: --9007199254740991
      • removedInput schema / properties / reporter_code / type
        Removed value: -"integer"
      • changedInput schema / required
        Previous value: -[
        -  "reporter_code",
        -  "flow_code",
        -  "period"
        -]New value: +[
        +  "flow_code",
        +  "period"
        +]
      • changedOutput schema / properties / error / properties / data / properties / reason / description
        Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `keyless_hs_edition_unsupported`: Explicit HS editions require authenticated data access. `invalid_reporter_filter`: Reporter omission lacks an explicit partner. `upstream_validation`: UN Comtrade rejects the query dimensions. `invalid_upstream_response`: UN Comtrade returns malformed trade data. Other values are possible when a failure originates below the handler."
      • addedOutput schema / properties / error / properties / data / properties / reason / examples
        Added value: +[
        +  "keyless_hs_edition_unsupported",
        +  "invalid_reporter_filter",
        +  "upstream_validation",
        +  "invalid_upstream_response"
        +]
      • addedOutput schema / properties / records / items / properties / altQty
        Added value: +{
        +  "description": "Alternate quantity, in its own unit.",
        +  "type": "number"
        +}
      • addedOutput schema / properties / records / items / properties / altQtyUnitAbbr
        Added value: +{
        +  "description": "Alternate quantity unit abbreviation.",
        +  "type": "string"
        +}
      • addedOutput schema / properties / records / items / properties / altQtyUnitCode
        Added value: +{
        +  "description": "Alternate quantity unit code.",
        +  "type": "number"
        +}
      • addedOutput schema / properties / records / items / properties / classificationCode
        Added value: +{
        +  "description": "Actual classification edition supplied by the row.",
        +  "type": "string"
        +}
      • addedOutput schema / properties / records / items / properties / isNetWgtEstimated
        Added value: +{
        +  "description": "Whether net weight is estimated.",
        +  "type": "boolean"
        +}
      • addedOutput schema / properties / records / items / properties / isQtyEstimated
        Added value: +{
        +  "description": "Whether quantity is estimated.",
        +  "type": "boolean"
        +}
      • addedOutput schema / properties / records / items / properties / qtyUnitAbbr
        Added value: +{
        +  "description": "Quantity unit abbreviation supplied or resolved from the unit catalog.",
        +  "type": "string"
        +}
      • addedOutput schema / properties / records / items / properties / qtyUnitCode
        Added value: +{
        +  "description": "Quantity unit code; -1 means unavailable.",
        +  "type": "number"
        +}
      • addedOutput schema / properties / unservedReporters
        Added value: +{
        +  "description": "Reporter codes beyond the 20-reporter work cap; query them separately.",
        +  "items": {
        +    "type": "number"
        +  },
        +  "type": "array"
        +}
    • Changedcomtrade_list_service_categories4 fields changed
      • changedInput schema / properties / parent_code / description
        Previous value: -"Return only sub-categories of this parent EBOPS code. Example: \"SA\" to see all transport service sub-categories."New value: +"Return direct children of this EB category code. Example: \"3\" for transport sub-categories, or \"3.1\" for sea transport sub-categories."
      • changedInput schema / properties / query / description
        Previous value: -"Keyword or category code prefix to filter results. Examples: \"transport\", \"SA\", \"financial services\". Omit to list all EBOPS categories."New value: +"Keyword or category code prefix to filter results. Examples: \"transport\", \"SA\", \"financial services\". Omit to list all EB categories."
      • changedOutput schema / properties / categories / description
        Previous value: -"EBOPS 2010 service categories matching the query."New value: +"EB service categories matching the query."
      • changedOutput schema / properties / categories / items / description
        Previous value: -"An EBOPS 2010 service trade category."New value: +"A service trade category from the combined EB catalog."
    • Changedcomtrade_lookup_countries1 field changed
      • changedOutput schema / properties / matches / description
        Previous value: -"Country/area entries matching the query, sorted by name."New value: +"Matching entries ordered by exact ISO identity, reporter validity, then name."
    • Changedcomtrade_search_commodities15 fields changed
      • changedInput schema / properties / aggr_level / anyOf
        Previous value: -[
        -  {
        -    "const": 2,
        -    "type": "number"
        -  },
        -  {
        -    "const": 4,
        -    "type": "number"
        -  },
        -  {
        -    "const": 6,
        -    "type": "number"
        -  }
        -]New value: +[
        +  {
        +    "const": 1,
        +    "type": "number"
        +  },
        +  {
        +    "const": 2,
        +    "type": "number"
        +  },
        +  {
        +    "const": 3,
        +    "type": "number"
        +  },
        +  {
        +    "const": 4,
        +    "type": "number"
        +  },
        +  {
        +    "const": 5,
        +    "type": "number"
        +  },
        +  {
        +    "const": 6,
        +    "type": "number"
        +  }
        +]
      • changedInput schema / properties / aggr_level / description
        Previous value: -"Aggregation level: 2 = HS chapter (most general), 4 = heading, 6 = subheading (most specific). Omit to return all matching levels."New value: +"Native aggregation level: HS uses 2 (chapter), 4 (heading), 6 (subheading); SITC uses 1–5. Omit to return all matching levels."
      • changedInput schema / properties / classification / description
        Previous value: -"HS classification version. \"HS\" covers the combined dataset across all editions (H0–H6). Use a specific edition (e.g. \"H6\") for version-specific lookups."New value: +"Goods reference catalog: HS uses the default HS.json discovery catalog, whose total identifies H6; it is not an authoritative historical-edition reference. Select H0–H6 for an explicit HS edition, or SS/S1–S4 for SITC."
      • changedInput schema / properties / classification / enum
        Previous value: -[
        -  "HS",
        -  "H0",
        -  "H1",
        -  "H2",
        -  "H3",
        -  "H4",
        -  "H5",
        -  "H6"
        -]New value: +[
        +  "HS",
        +  "H0",
        +  "H1",
        +  "H2",
        +  "H3",
        +  "H4",
        +  "H5",
        +  "H6",
        +  "SS",
        +  "S1",
        +  "S2",
        +  "S3",
        +  "S4"
        +]
      • changedInput schema / properties / query / description
        Previous value: -"Keyword, partial description, or HS code prefix to search for. Examples: \"motor vehicles\", \"8471\", \"coffee\", \"84\" (chapter 84 = machinery)."New value: +"Keyword, partial description, or commodity code prefix. Examples: \"motor vehicles\", \"8471\", \"coffee\", \"84\" (HS chapter 84 = machinery)."
      • changedOutput schema / anyOf
        Previous value: -[
        -  {
        -    "not": {
        -      "required": [
        -        "error"
        -      ]
        -    },
        -    "required": [
        -      "matches",
        -      "totalMatches",
        -      "shown",
        -      "truncated"
        -    ]
        -  },
        -  {
        -    "required": [
        -      "error"
        -    ]
        -  }
        -]New value: +[
        +  {
        +    "not": {
        +      "required": [
        +        "error"
        +      ]
        +    },
        +    "required": [
        +      "classification",
        +      "matches",
        +      "totalMatches",
        +      "shown",
        +      "truncated"
        +    ]
        +  },
        +  {
        +    "required": [
        +      "error"
        +    ]
        +  }
        +]
      • addedOutput schema / properties / classification
        Added value: +{
        +  "description": "Reference catalog used for the search.",
        +  "type": "string"
        +}
      • changedOutput schema / properties / error / properties / data / properties / reason / description
        Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_aggregation_level`: The requested level does not belong to the selected classification family. Other values are possible when a failure originates below the handler."
      • addedOutput schema / properties / error / properties / data / properties / reason / examples
        Added value: +[
        +  "invalid_aggregation_level"
        +]
      • changedOutput schema / properties / matches / description
        Previous value: -"HS codes matching the query."New value: +"Commodity codes matching the query in the selected classification."
      • changedOutput schema / properties / matches / items / description
        Previous value: -"A single HS commodity code entry."New value: +"A commodity entry from the selected catalog."
      • changedOutput schema / properties / matches / items / properties / aggrLevel / description
        Previous value: -"Aggregation level: 2 (chapter), 4 (heading), 6 (subheading)."New value: +"Native aggregation level in the selected HS or SITC catalog."
      • changedOutput schema / properties / matches / items / properties / id / description
        Previous value: -"HS code string (e.g. \"84\", \"8471\", \"847130\")."New value: +"Commodity code in the selected classification, preserving leading zeros."
      • changedOutput schema / properties / matches / items / properties / parent / description
        Previous value: -"Parent HS code (chapter for headings; heading for subheadings)."New value: +"Parent commodity code in the selected classification."
      • changedOutput schema / properties / matches / items / properties / recommendedQueryCode / description
        Previous value: -"Best code to pass as cmd_code in trade data queries for this commodity. Uses the most specific level that returns meaningful data."New value: +"Code to pass as cmd_code with the same classification in trade data queries."
  2. 9 tool updates
    • First observedcomtrade_get_data_availability
    • First observedcomtrade_get_services_trade
    • First observedcomtrade_get_top_commodities
    • First observedcomtrade_get_top_partners
    • First observedcomtrade_get_trade_balance
    • First observedcomtrade_get_trade_flows
    • First observedcomtrade_list_service_categories
    • First observedcomtrade_lookup_countries
    • First observedcomtrade_search_commodities

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides access to UN Comtrade international bilateral trade data via an MCP server, enabling AI agents to query trade statistics through natural language.
    424 npm
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    An MCP server for the U.S. Census Bureau's International Trade Data API, enabling queries of monthly export and import statistics by HS, NAICS, end-use, and other classifications, with tools for trade balance, top partners, and country code lookup.
    7
    Creative Commons Zero v1.0 Universal
  • A
    license
    Not graded
    quality
    B
    maintenance
    Read-only MCP tools for querying USDA FAS Global Agricultural Trade System census export and import records by partner country, year, month and HS10 code prefix, plus the release-date lists for each flow. Results are capped with notes on omitted rows, and responses carry release vintages and retrieval metadata.
    227 PyPI
    Apache 2.0
  • A
    license
    A
    quality
    B
    maintenance
    Enables querying Brazilian foreign trade data through MCP tools for trade flows, freight costs, code resolution, and dataset caveats, with known data defects corrected in responses.
    4
    MIT
Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.