Skip to main content
Glama

un-comtrade-mcp-server

Get Top Services Trading Partners

comtrade_get_top_services_partners
Read-only

Rank partners of one reporter by trade value for a single annual EBOPS series. Omit service_code for total services, or use comtrade_list_service_categories to find one category. EB serves original reports, while EB10 and EB02 serve converted series. Shares divide by the sum of eligible retrieved partners before the display limit. Read coverageNotice before interpreting the ranking.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "reporter_code": "<reporter_code>",
      "flow_code": "<flow_code>",
      "period": "<period>"
    },
    "name": "comtrade_get_top_services_partners"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of partners to display. Counts and sums precede the display limit.
periodYesOne annual period, YYYY.
flow_codeYesTrade flow: M=imports, X=exports.
service_codeNoOne EBOPS service code. Omit or pass blank for total services.
reporter_codeYesM49 numeric code of the reporting area (0–999).
classificationNoEB for as-reported data (default), or EB10 or EB02 for UN Comtrade’s converted series.EB

Output Schema

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoNext steps when no services series is selected.
periodNoAnnual period queried.
flowCodeNoTrade flow queried.
partnersNoRetrieved partners, ordered by descending value when available.
truncatedNoTrue when the upstream retrieval was capped or incomplete.
serviceCodeNoSelected service category or scheme total code.
reporterCodeNoM49 code of the reporting area.
reporterDescNoReporting area name.
totalPartnersNoEligible retrieved partners before the display limit.
totalValueUsdNoSum of eligible retrieved partner values before the limit, when all are known.
classificationNoServices classification requested.
coverageNoticeNoScope of the retrieved data and conditions that prevent ranking.
referenceNoticeNoReference descriptions unavailable.
classificationCodeNoActual scheme of the selected series.
isOriginalClassificationNoTrue for an original series, false for a UN Comtrade conversion, when established.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover the read-only and open-world profile, and the description adds real value on top: it explains what EB vs EB10/EB02 mean in practice, how shares are computed (divided by the sum of eligible retrieved partners before the display limit), and warns to read coverageNotice before interpreting the ranking. That last caveat surfaces a data-quality trap that no annotation exposes.

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?

Four tight sentences, front-loaded with the verb and scope, and each one carries distinct information (purpose, code lookup, classification meaning, share math, coverage caveat). No filler, though the density makes it slightly slower to parse than an ideal definition.

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, return values need no explanation, and the description covers classification choice, share computation, and a data-coverage caveat for a 6-parameter tool. Minor gaps remain: ranking direction, tie handling, and how non-reporting partners are treated are only indirectly implied by 'eligible retrieved partners'.

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 earns one above it by tying service_code omission to 'total services', pointing at comtrade_list_service_categories for valid codes, and clarifying that share denominators are computed before the display limit — semantics the schema's own wording does not fully convey.

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 description states a specific verb and resource: 'Rank partners of one reporter by trade value' restricted to 'a single annual EBOPS series'. The services/EBOPS framing lets an agent distinguish it from goods-oriented siblings such as comtrade_get_top_partners and comtrade_get_top_commodities, though it never names those alternatives outright.

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 clear operating guidance within the call: omit service_code for total services, or route through comtrade_list_service_categories to pick a category. It does not state explicit when-not conditions or contrast directly with the other top-N tools, so an agent must infer boundaries.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.