Skip to main content
Glama

UN Comtrade Trade Flows — Import & Export by Country

trade_flows
Read-only

Query UN Comtrade for import and export trade flows

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "reporter_countries": "<reporter_countries>"
    },
    "name": "trade_flows"
  }
}

Input Schema

NameRequiredDescriptionDefault
yearsNoYears to report (e.g
trade_flowNoImports, exports or both
apify_api_keyNoYour Apify API token (optional). When provided the actor runs live and returns real data. Get one free at https://apify.com/sign-up
comtrade_api_keyNoOptional free UN Comtrade subscription key for full (non-preview) data and higher limits
products_hs_codesNoHS commodity codes (e.g
reporter_countriesYesThe countries whose trade to report — ISO3 code (e.g

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / apify_api_key
      Added value: +{
      +  "description": "Your Apify API token (optional). When provided the actor runs live and returns real data. Get one free at https://apify.com/sign-up",
      +  "type": "string"
      +}
  2. Changed7 schema fields changed
    • addedInput schema / properties / comtrade_api_key
      Added value: +{
      +  "description": "Optional free UN Comtrade subscription key for full (non-preview) data and higher limits",
      +  "type": "string"
      +}
    • removedInput schema / properties / input
      Removed value: -{
      -  "description": "Input for Import & Export Trade Data — UN Comtrade (by Product & Country). See https://apify.com/noniner/trade-flows.",
      -  "type": "object"
      -}
    • addedInput schema / properties / products_hs_codes
      Added value: +{
      +  "description": "HS commodity codes (e.g",
      +  "type": "string"
      +}
    • addedInput schema / properties / reporter_countries
      Added value: +{
      +  "description": "The countries whose trade to report — ISO3 code (e.g",
      +  "type": "string"
      +}
    • addedInput schema / properties / trade_flow
      Added value: +{
      +  "description": "Imports, exports or both",
      +  "type": "string"
      +}
    • addedInput schema / properties / years
      Added value: +{
      +  "description": "Years to report (e.g",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "reporter_countries"
      +]
  3. Added

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=true and idempotentHint=false, so the description owes little on the safety front. However it adds nothing beyond them — it does not disclose that results may be preview-only without an Apify key, that UN Comtrade subscription keys change coverage and rate limits, or what happens when a query is retried under non-idempotent semantics.

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?

A single front-loaded sentence with no filler or redundancy; the purpose is stated immediately. It is efficient, though the terseness borders on under-specification given the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter, non-idempotent, open-world data query with a tiered API-key model and no output schema, the description is too thin. The most decision-relevant behavior — preview vs live data and the role of the two keys — exists only in schema field text, not in the description.

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 documented structurally, establishing the baseline of 3. The description adds no meaning beyond the schema — for example nothing about ISO3 formatting, HS code granularity, or how the two API keys interact with data quality.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Query UN Comtrade for import and export trade flows'), and the title reinforces the domain (import/export by country). It is unambiguous about what the tool does, though it does not distinguish itself from any alternative data source.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use, when-not-to-use, or prerequisite guidance beyond the implied 'query trade data'. Nothing tells the agent when this is preferable to another data tool, or what conditions (e.g. needing live vs preview data) should drive the call.

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.