Skip to main content
Glama

Trustbase Lab · Trusted Data Infrastructure for the AI Era

Trade Flow Summary

get_trade_flow_summary
Read-onlyIdempotent

Purpose: aggregate the UN Comtrade carbon black (HS 280300) records for a period - per reporter totals for quantity and value, the weighted unit price, and the top-10 partner countries by quantity. Guidelines: pass period (YYYY) or leave empty to aggregate all periods (2024-2025); weighted price equals total value divided by total quantity; pair with get_trade_partner_ranking to drill into a single reporter. Limits: customs-reported totals only - no commercial quote platform data; World aggregate rows are excluded from partner rankings; unit prices are not comparable across reporters where quantity reporting is incomplete. Ex: get_trade_flow_summary(period='2025'), get_trade_flow_summary(response_format='json').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNo期间 YYYY,如 2024;留空则汇总全部期间
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?

The description goes well beyond annotations by specifying the weighted-unit-price formula, exclusion of World aggregate rows from partner rankings, customs-reporting limitation, and comparability caveats. These are behavioral traits the readOnly/idempotent annotations do not communicate.

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/Ex with no filler. Each sentence contributes either an aggregation behavior, usage constraint, or caveat, and the most important scoping rule appears early.

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?

Given only 2 optional parameters, an output schema, and read-only/idempotent annotations, the description supplies all essential selection and invocation context: output contents, period handling, formula, pairing guidance, and data caveats. Nothing needed to call the tool safely is missing.

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 both parameters are already documented. The description reinforces period semantics and gives an example call, but the added meaning over the schema is marginal; 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?

Purpose states a specific verb ('aggregate'), a concrete data source (UN Comtrade carbon black HS 280300 records), and exact outputs (per-reporter totals, weighted unit price, top-10 partners). It also references get_trade_partner_ranking, making its niche distinct from the sibling ranking tool.

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?

Guidelines explicitly tell the agent how to parameterize the call (pass YYYY or leave empty) and to pair it with get_trade_partner_ranking for single-reporter drill-down. It does not explicitly enumerate when to avoid this tool or compare to query_trade_flows, but the guidance is concrete enough for correct invocation.

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