Skip to main content
Glama

UN Comtrade Data Availability

comtrade.trade.availability
Read-onlyIdempotent

Check which trade datasets are available in UN Comtrade for a given reporter country and period. Returns dataset metadata including total record count, first/last release dates, and classification codes. Useful for discovering what data exists before querying comtrade.trade_data. Coverage varies by country — developed economies report more frequently and with fewer delays than others. Source: UN Comtrade public preview API, no auth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoFilter by reference period. Annual: 4-digit year (e.g. "2022"). Monthly: YYYYMM (e.g. "202209"). Omit to list all available periods.
cmd_codeNoFilter by commodity code (e.g. "84", "TOTAL"). Omit for all commodities.
flow_codeNoFilter by trade flow: M=Imports, X=Exports, MX=Both. Omit for all flows.
freq_codeNoFrequency. A=Annual (default), M=Monthly.
type_codeNoData type. C=Commodities (default), S=Services.
reporter_codeNoUN numeric code for the reporting country to check. Omit to list all available reporters. Example: 276=Germany, 840=USA, 156=China.
classificationNoClassification system. HS=Harmonized System (default).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds value beyond these by disclosing 'no auth' required, the 'public preview API' nature, and the coverage caveat that 'developed economies report more frequently and with fewer delays than others.' This provides useful real-world behavioral context beyond the safety profile.

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?

The description is four sentences with zero filler: it front-loads the core function, lists the return metadata, gives usage context, and ends with a coverage caveat and source/auth note. Every sentence earns its place.

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 the full input schema, the output schema, and annotations covering safety, the description is nearly complete. It covers purpose, usage, auth requirements, and a data-quality caveat. The only minor gap is referring to 'comtrade.trade_data' when the actual sibling appears to be comtrade.trade.query, and it does not differentiate itself from comtrade.trade.metadata.

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%, and each parameter already has detailed descriptions with formats, enums, defaults, and examples. The tool description adds no extra parameter-level information beyond the schema; it only mentions 'reporter country and period' in prose. Baseline 3 is appropriate because the schema carries the full semantic weight.

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 description uses a specific verb ('Check') and resource ('which trade datasets are available in UN Comtrade') and states the return contents: 'dataset metadata including total record count, first/last release dates, and classification codes.' This clearly distinguishes it from data querying tools like comtrade.trade_data.

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?

The phrase 'Useful for discovering what data exists before querying comtrade.trade_data' explicitly tells the agent when to use this tool relative to the data query tool. However, it does not mention or exclude related sibling tools like comtrade.trade.metadata or comtrade.reference.reporters, so the routing guidance is good but not exhaustive.

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.