Skip to main content
Glama

UN Comtrade Dataset Metadata

comtrade.trade.metadata
Read-onlyIdempotent

Retrieve methodological metadata for a UN Comtrade dataset: the reporting currency, USD conversion factors applied (import/export), trade system used (General vs Special trade), import/export valuation method (CIF vs FOB), partner country attribution rules, and publication notes. Essential for understanding how to interpret the trade values in comtrade.trade_data results. Each country reports using its own methodology and currency — this endpoint reveals those details. Source: UN Comtrade public preview API, no auth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYesReference period. Annual: 4-digit year (e.g. "2022"). Monthly: YYYYMM (e.g. "202209"). Returns currency conversion factors, trade system, valuation notes for this dataset.
freq_codeNoFrequency. A=Annual (default), M=Monthly.
type_codeNoData type. C=Commodities (default), S=Services.
show_historyNoInclude historical revisions in the metadata response. Default false (returns only the latest version).
reporter_codeYesUN numeric code for the reporting country. Example: 276=Germany, 840=USA, 156=China. Use comtrade.reporters to look up codes.
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.1/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, covering the safety profile. The description adds valuable behavioral context: 'Source: UN Comtrade public preview API, no auth' and lists what the response includes. This exceeds the baseline by providing auth requirements and content expectations without contradicting the annotations.

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?

The description is two sentences: the first front-loads the core purpose with an enumeration of returned metadata, and the second adds the crucial interpretive context and source/auth note. Every clause adds value, and the length is appropriate for a metadata tool with six parameters. It is not verbose or redundant.

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?

The description explains the purpose, the context of use (interpreting trade_data), and the source/auth requirements. With an output schema present, the return structure is already documented. Required parameters (reporter_code, period) are defined in the schema, and the description does not need to restate them. For a read-only metadata retrieval tool, this is sufficiently complete.

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%, so all six parameters are already documented in the schema with detailed descriptions. The tool description adds no parameter-specific semantics beyond the schema, so it earns the baseline of 3. It does not compensate for any gaps because none exist.

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 clearly states the verb 'Retrieve' and the resource 'methodological metadata for a UN Comtrade dataset', enumerating specific details (currency, conversion factors, trade system, valuation, etc.). It also distinguishes itself from trade_data by positioning itself as essential for interpreting those results, and its role as a metadata companion is unambiguous.

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 description explicitly states when to use this tool: 'Essential for understanding how to interpret the trade values in comtrade.trade_data results.' This gives clear context and implies it should be used before or alongside trade_data. It does not name alternative tools or provide explicit exclusions, but the context is sufficient for an agent to select it appropriately.

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.