comtrade_top_commodities

Pack: comtrade · Endpoint: https://gateway.pipeworx.io/comtrade/mcp

Find top commodities traded between two countries ranked by value. Returns product categories and trade volumes.

Parameters

NameTypeRequiredDescription
reporter_codestringyesISO numeric country code for the reporting country
partner_codestringyesISO numeric country code for the partner country
yearstringyesTrade year (e.g., “2024”)
flowstringyesTrade flow: “M” for imports, “X” for exports
limitnumbernoNumber of top commodities to return (default 20)

Example call

Arguments

{
  "reporter_code": "840",
  "partner_code": "156",
  "year": "2024",
  "flow": "M",
  "limit": 15
}

curl

curl -X POST https://gateway.pipeworx.io/comtrade/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"comtrade_top_commodities","arguments":{"reporter_code":"840","partner_code":"156","year":"2024","flow":"M","limit":15}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('comtrade_top_commodities', {
  "reporter_code": "840",
  "partner_code": "156",
  "year": "2024",
  "flow": "M",
  "limit": 15
});

More examples

{
  "reporter_code": "392",
  "partner_code": "840",
  "year": "2023",
  "flow": "X"
}

Response shape

Always returns: reporter, partner, year, flow, total_commodities, top_commodities

FieldTypeDescription
reporterstringReporting country name
partnerstringPartner country name
yearstringTrade year queried
flowstringTrade flow type (Imports or Exports)
total_commoditiesnumberTotal number of top commodities returned
top_commoditiesarrayList of top traded commodities ranked by value
Full JSON Schema
{
  "type": "object",
  "properties": {
    "reporter": {
      "type": "string",
      "description": "Reporting country name"
    },
    "partner": {
      "type": "string",
      "description": "Partner country name"
    },
    "year": {
      "type": "string",
      "description": "Trade year queried"
    },
    "flow": {
      "type": "string",
      "description": "Trade flow type (Imports or Exports)"
    },
    "total_commodities": {
      "type": "number",
      "description": "Total number of top commodities returned"
    },
    "top_commodities": {
      "type": "array",
      "description": "List of top traded commodities ranked by value",
      "items": {
        "type": "object",
        "properties": {
          "rank": {
            "type": "number",
            "description": "Commodity rank by trade value"
          },
          "hs_code": {
            "type": "string",
            "description": "HS commodity code"
          },
          "commodity": {
            "type": "string",
            "description": "Commodity description"
          },
          "trade_value_usd": {
            "type": "number",
            "description": "Trade value for this commodity in USD"
          },
          "net_weight_kg": {
            "type": "number",
            "description": "Net weight in kilograms"
          }
        }
      }
    }
  },
  "required": [
    "reporter",
    "partner",
    "year",
    "flow",
    "total_commodities",
    "top_commodities"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "comtrade": {
      "url": "https://gateway.pipeworx.io/comtrade/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026