Skip to main content
Glama

Primary Source Commodities

Countries Ranked by Trade

trade.ranking
Read-onlyIdempotent

Largest exporting or importing countries for a commodity in a year, ranked by value, each with the implied unit value it realised. Use for 'who are the biggest cocoa exporters' and 'which sourcing market is cheapest'. EXPORTS ARE NOT PRODUCTION: a country can be a large exporter of something it does not grow — the Netherlands ranks sixth in cocoa exports and grows none. Completeness cannot be verified for this shape, so complete is always null.

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": {
      "commodity": "<commodity>",
      "year": "<year>"
    },
    "name": "trade.ranking"
  }
}

Input Schema

NameRequiredDescriptionDefault
flowNoexport ranks exporters, import ranks importers.
yearYesFour-digit year. Example: 2023.
limitNoMaximum rows returned, 1-200 (default 25).
commodityYesInstrument code with an HS heading. Example: CC for cocoa.

Output Schema

NameRequiredDescriptionDefault
flowNo
yearYes
notesYesCaveats the numbers cannot carry. Read these before presenting a unit value.
sourceNo
completeNoAlways null here: the upstream publishes no aggregate over all reporters to reconcile against
returnedNo
commodityYes
reportersYesCountries, highest value first. Ranked by this service, not by the upstream, which returns rows ordered by country code.
license_tagNo
reporter_countNoReporters the upstream returned, before any limit

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world, non-destructive, so the bar is lower. The description adds genuine context beyond them: the exports-are-not-production caveat with the Netherlands cocoa example, and the non-obvious fact that `complete` is always null because completeness can't be verified. Ranking tie-breaks and data freshness are not covered.

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?

Purpose is front-loaded, followed by two short use cases and the critical caveat. It is dense but each sentence carries information; the Netherlands example is a deliberate concrete illustration rather than filler.

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?

An output schema exists, so return values need no explanation; the description still flags the always-null `complete` field, which is the key exception. With full schema coverage and complete annotations, only minor details remain.

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 flow, year, limit, and commodity are fully documented by the schema. The description's contribution ('ranked by value', 'implied unit value') describes output semantics rather than adding input-side meaning. 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?

States a specific verb and resource: countries ranked by value of exports or imports for a commodity in a year, each with implied unit value. The ranking shape distinguishes it from list/flow siblings such as trade.flow and trade.partners.

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?

Two concrete example questions ('who are the biggest cocoa exporters', 'which sourcing market is cheapest') anchor when to use it. It does not name an alternative tool or state when not to use it, though the production caveat implicitly steers agents that want output volumes elsewhere.

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.

Resources