Skip to main content
Glama

Primary Source Commodities

Country and HS Code Reference

trade.codes
Read-onlyIdempotent

Resolve a country to the UN M49 code the trade tools require, and list the HS headings this catalog maps. FREE. Call this BEFORE trade.flow, trade.partners or trade.ranking: those take a reporter code and there is no other way to discover one. Accepts ISO3, ISO2, a numeric M49 or an exact country name. Historical entities are excluded by default — twelve ISO3 codes resolve to more than one UN Comtrade entry and the expired one is never preferred, so IND gives India rather than pre-1974 India.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "trade.codes"
  }
}

Input Schema

NameRequiredDescriptionDefault
countryNoISO3, ISO2, numeric M49 or exact name to resolve. Omit to list HS headings only.

Output Schema

NameRequiredDescriptionDefault
noteNo
resolvedNoThe matched country, when one was asked for
commoditiesYesInstrument code to HS heading

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/closed-world/non-destructive, and the description goes further by disclosing the disambiguation rule: historical entities are excluded by default, twelve ISO3 codes map to multiple UN Comtrade entries, and the expired entry is never preferred. The IND/India example converts that rule into something an agent can predict.

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 action and the ordering constraint, with no filler. The historical-entity sentence is somewhat long relative to its point, and could be tightened without losing information, but every sentence contributes.

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?

A single optional parameter, full schema coverage, an output schema, and complete annotations leave little unsaid, and the description still supplies the discovery rationale and the ambiguity-resolution rule an agent cannot infer from structured fields. Nothing needed to invoke it 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 coverage is 100% and the single parameter already documents ISO3/ISO2/M49/name acceptance and the omit-to-list-headings behavior. The description's parameter sentence restates the schema rather than adding syntax, normalization or error semantics, so this sits at the baseline where the schema does the work.

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 specific verbs and resources: resolve a country to a UN M49 code, and list the HS headings the catalog maps. It also names the dependent tools (trade.flow, trade.partners, trade.ranking) that consume the code, so an agent can tell exactly what this tool produces versus the tools that consume it.

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 an explicit ordering instruction ('Call this BEFORE trade.flow, trade.partners or trade.ranking') plus the reason ('those take a reporter code and there is no other way to discover one'), which is the strongest form of when-to-use guidance. It also flags the tool as FREE, which matters for quota-sensitive routing against account.quota.

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.

Resources