Skip to main content
Glama

Comtrade Top Partners

comtrade_top_partners
Read-onlyIdempotent

Find a country's top trading partners ranked by trade volume. Returns partner countries and total trade values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowYesTrade flow: "M" for imports, "X" for exports
yearYesTrade year (e.g., "2024")
limitNoNumber of top partners to return (default 20)
hs_codeNoOptional HS commodity code to filter by specific product
reporter_codeYesCountry name (e.g. "USA", "China") or UN numeric code (842=US). Names resolved automatically.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowYesTrade flow type (Imports or Exports)
yearYesTrade year queried
reporterYesReporting country name
top_partnersYes
total_partnersYesTotal number of top partners returned

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • changedInput schema / properties / reporter_code / description
      Previous value: -"ISO numeric country code (e.g., \"842\" for US)"New value: +"Country name (e.g. \"USA\", \"China\") or UN numeric code (842=US). Names resolved automatically."
  2. Changed1 schema field changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "flow": "X",
      -    "limit": 10,
      -    "reporter_code": "840",
      -    "year": "2024"
      -  },
      -  {
      -    "flow": "M",
      -    "reporter_code": "156",
      -    "year": "2023"
      -  }
      -]New value: +[
      +  {
      +    "flow": "X",
      +    "limit": 10,
      +    "reporter_code": "842",
      +    "year": "2024"
      +  },
      +  {
      +    "flow": "M",
      +    "reporter_code": "156",
      +    "year": "2023"
      +  }
      +]
  3. Changed3 schema fields changed
    • removedOutput schema / properties / top_partners / description
      Removed value: -"List of top trading partners ranked by trade value"
    • changedOutput schema / properties / top_partners / items / properties / partner_code / description
      Previous value: -"ISO numeric country code"New value: +"Partner ISO numeric country code"
    • changedOutput schema / properties / top_partners / items / properties / trade_value_usd / description
      Previous value: -"Trade value with this partner in USD"New value: +"Trade value in USD"
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "flow": {
      +      "description": "Trade flow type (Imports or Exports)",
      +      "type": "string"
      +    },
      +    "reporter": {
      +      "description": "Reporting country name",
      +      "type": "string"
      +    },
      +    "top_partners": {
      +      "description": "List of top trading partners ranked by trade value",
      +      "items": {
      +        "properties": {
      +          "commodity": {
      +            "description": "Commodity code or description",
      +            "type": "string"
      +          },
      +          "partner": {
      +            "description": "Partner country name",
      +            "type": "string"
      +          },
      +          "partner_code": {
      +            "description": "ISO numeric country code",
      +            "type": "number"
      +          },
      +          "rank": {
      +            "description": "Partner rank by trade value",
      +            "type": "number"
      +          },
      +          "trade_value_usd": {
      +            "description": "Trade value with this partner in USD",
      +            "type": "number"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "total_partners": {
      +      "description": "Total number of top partners returned",
      +      "type": "number"
      +    },
      +    "year": {
      +      "description": "Trade year queried",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "reporter",
      +    "year",
      +    "flow",
      +    "total_partners",
      +    "top_partners"
      +  ],
      +  "type": "object"
      +}
  5. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "flow": "X",
      +    "limit": 10,
      +    "reporter_code": "840",
      +    "year": "2024"
      +  },
      +  {
      +    "flow": "M",
      +    "reporter_code": "156",
      +    "year": "2023"
      +  }
      +]
  6. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already indicate read-only, idempotent, non-destructive behavior. The description adds only that it returns partner countries and total trade values, adding minimal behavioral context beyond what annotations provide.

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?

Two concise sentences that front-load the purpose with no extraneous information. Every sentence is informative and necessary.

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 tool's simplicity, use of an output schema, and rich annotations, the description is adequately complete. It explains the core function without needing to detail return values.

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?

The input schema has 100% description coverage for all 5 parameters. The description does not add additional meaning or clarifications beyond the schema, so baseline 3 is appropriate.

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 'Find' and the resource 'a country's top trading partners', specifying ranking by trade volume and output format. This distinguishes it from sibling tools like comtrade_country_codes and 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 Guidelines3/5

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

The description implies use for fetching top partners, but does not provide explicit guidance on when to use this tool versus alternatives like comtrade_trade_data or comtrade_country_codes.

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.