Skip to main content
Glama

un-comtrade-mcp-server

Lookup Countries / Areas

comtrade_lookup_countries
Read-only

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.

Input Schema

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

NameRequiredDescriptionDefault
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema 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."
  2. First observed

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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.