Skip to main content
Glama

Trustbase Lab · rCB & Chemical Recycling Data

Trade Partner Ranking

get_trade_partner_ranking
Read-onlyIdempotent

Purpose: rank partner countries for one reporter, period and flow direction by quantity, returning rank,partner, quantity, value, unit price and share. Guidelines: reporter (ISO3 alpha), period (YYYY) and flow (X =export, M = import) are required; raise top_n above the default 10 (max 50) only when a longer tail is needed.Limits: one reporter-period-flow combination per call; World aggregate rows are excluded; shares are computedwithin the returned set, not against global trade. Ex: get_trade_partner_ranking(reporter='CHN', period='2025',flow='X'), get_trade_partner_ranking(reporter='USA', period='2024', flow='M', top_n=20).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowNo流向 X=出口/M=进口
top_nNoTop N 伙伴国(默认 10,最大 50)
periodYes期间 YYYY(必填,如 2024)
reporterYes报告国 ISO3,必要
response_formatNoOutput format: 'markdown' (default, human-readable) or 'json' (machine-readable).markdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesHuman-readable result (markdown, or a JSON string when response_format=json).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / response_format / description
      Added value: +"Output format: 'markdown' (default, human-readable) or 'json' (machine-readable)."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "text": {
      +      "description": "Human-readable result (markdown, or a JSON string when response_format=json).",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "text"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description discloses operational nuances: World aggregate rows are excluded, shares are computed within the returned set rather than against global trade, and only one reporter-period-flow combination is allowed per call. These are non-obvious behaviors an agent needs to interpret results correctly.

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?

The description is organized into Purpose, Guidelines, Limits, and Examples, with every sentence adding useful information. It is long but not bloated; the examples at the end demonstrate realistic calls without explaining what the code already shows.

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

Completeness5/5

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

For a read-only ranking tool with an output schema, the description provides everything needed to select and invoke it correctly: input constraints, result semantics, limits on the response tail, and worked examples. The only caveat is the flow-required mismatch already noted, but that doesn't leave a major contextual gap.

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 coverage is 100%, so the schema already documents all five parameters. The description reinforces formats (ISO3, YYYY, X/M) and gives working examples, but mostly repeats schema info; it also states 'flow... required' while the schema's required array omits flow, creating a notable inconsistency that prevents a higher score.

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?

Starts with a specific verb+resource: 'rank partner countries for one reporter, period and flow direction by quantity', and lists the exact returned fields (rank, partner, quantity, value, unit price, share). This is clearly distinct from sibling tools like get_trade_flow_summary or query_trade_flows, which do not promise ranking with share calculations.

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?

Explicit 'Guidelines' and 'Limits' sections state the required inputs, the condition for raising top_n ('only when a longer tail is needed'), and the one-combination-per-call constraint. It lacks an explicit when-not-to-use or named alternative, so it stops short of full 5.

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