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

TableJSON 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

TableJSON 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.
matchesNoCountry/area entries matching the query, sorted by name.
totalMatchesNoTotal number of matching entries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.