Skip to main content
Glama

TradeStats - customs trade statistics

get_breadth

How widespread a rise or fall in one country's trade is: for each month, the share of items (HS2 chapters, HS4 headings or HS6 subheadings, all or under one chapter) whose value in the latest window of 3 or 12 months is higher than in the same months a year earlier. Two shares are given because small items can dominate a count: share_up_by_count counts every item once, share_up_by_value weights each item by its value. share_accelerating is the share of items whose year-on-year growth is higher than the same window's year-on-year growth 3 months earlier (out of n_items; items with no comparable figure 3 months earlier count as not accelerating); total_yoy is the change of the whole level. n_items is the number of items compared and n_excluded the number left out because they cannot be compared fairly (no comparable prior-year value, a missing month in the window, or a change of HS version for HS4 and HS6); they are counted in n_excluded and not guessed, and never counted as zero. A month with no figure is not in the series: notes give the reason (not_computed_yet, or definition_break when the source definition changed). Give "reporter" and "flow" (one country, one direction); "level" (default hs4), "parent" (a 2-digit chapter, only with hs4 or hs6), "window" (3 or 12, default 12), "from", "to" and "limit" (newest months first, default 36, at most 200). Use it for questions such as whether a rise in imports is broad or driven by a few items. Limits: at the hs2 level the HS revisions can move goods between chapters, so an hs2 change across an HS version change can be distorted; hs4 and hs6 windows that cross an HS version change are not compared. The figures are our own calculation from public customs statistics, not official figures. They show how widespread a movement is, not its causes: exchange rates, stocks, seasons and classification changes cannot be told apart here. Only reporters that are published are answered. Cross-country synchrony: instead of "reporter" give "reporters" (2 to 4 countries; level hs2 only, all chapters): the answer then holds each country's series over the months common to all of them (newest 24) and a synchrony block with the share of those months in which the countries' total_yoy moved in the same direction and the correlation of total_yoy and of share_up_by_value (null with a reason when there are fewer than 12 common months or no variation). With 3 or 4 countries every pair is listed in synchrony.pairs; the top-level share pools the months of all pairs and the correlations are the simple mean of the pairwise ones. Only per-country totals are compared, never items between countries; the sample is only the countries given, and the correlation is indicative, not a forecast and not a cause. Reference information computed mechanically from public statistics; not investment advice, a credit rating or a trading recommendation.

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": {
      "flow": "<flow>"
    },
    "name": "get_breadth"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoOptional. Last month, YYYY-MM, or a year, YYYY (read as YYYY-12). Default: the latest month.
flowYesRequired. "import" (goods entering the reporting country) or "export" (goods leaving it); there is no combined view: "both" does not exist. For a comparison across countries use compare_countries, for exports minus imports use get_balance.
fromNoOptional. First month, YYYY-MM, or a year, YYYY (read as YYYY-01).
levelNoOptional. The level of the items counted: hs2 (chapters), hs4 (headings, default) or hs6 (subheadings).
limitNoOptional. Number of newest months to return (default 36, at most 200).
parentNoOptional. A 2-digit HS chapter (e.g. "85"): only the items under it are counted. Only with level hs4 or hs6. Omit for all items of the level.
windowNoMonths in the window compared with the same months a year earlier: 3 or 12 (default 12).
reporterNoThe reporting country whose customs statistics are read (JP, US, GB or EU). Give "reporter" OR "reporters"; flow is required.
reportersNoOptional, instead of reporter: 2 to 4 countries ("JP", "US", "GB" or "EU") whose hs2 breadth is compared (a comma-separated list in a query string). Level must be hs2 or omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / reporter / description
      Previous value: -"The reporting country whose customs statistics are read (JP, US or GB). Give \"reporter\" OR \"reporters\"; flow is required."New value: +"The reporting country whose customs statistics are read (JP, US, GB or EU). Give \"reporter\" OR \"reporters\"; flow is required."
    • changedInput schema / properties / reporter / enum
      Previous value: -[
      -  "JP",
      -  "US",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB",
      +  "EU"
      +]
    • changedInput schema / properties / reporters / description
      Previous value: -"Optional, instead of reporter: 2 to 4 countries (\"JP\", \"US\" or \"GB\") whose hs2 breadth is compared (a comma-separated list in a query string). Level must be hs2 or omitted."New value: +"Optional, instead of reporter: 2 to 4 countries (\"JP\", \"US\", \"GB\" or \"EU\") whose hs2 breadth is compared (a comma-separated list in a query string). Level must be hs2 or omitted."
    • changedInput schema / properties / reporters / items / enum
      Previous value: -[
      -  "JP",
      -  "US",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB",
      +  "EU"
      +]
  2. Changed4 schema fields changed
    • changedInput schema / properties / reporter / description
      Previous value: -"The reporting country whose customs statistics are read (JP or GB). Give \"reporter\" OR \"reporters\"; flow is required."New value: +"The reporting country whose customs statistics are read (JP, US or GB). Give \"reporter\" OR \"reporters\"; flow is required."
    • changedInput schema / properties / reporter / enum
      Previous value: -[
      -  "JP",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB"
      +]
    • changedInput schema / properties / reporters / description
      Previous value: -"Optional, instead of reporter: 2 to 4 countries (\"JP\" or \"GB\") whose hs2 breadth is compared (a comma-separated list in a query string). Level must be hs2 or omitted."New value: +"Optional, instead of reporter: 2 to 4 countries (\"JP\", \"US\" or \"GB\") whose hs2 breadth is compared (a comma-separated list in a query string). Level must be hs2 or omitted."
    • changedInput schema / properties / reporters / items / enum
      Previous value: -[
      -  "JP",
      -  "GB"
      -]New value: +[
      +  "JP",
      +  "US",
      +  "GB"
      +]
  3. Added

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so unusually well: it explains what is excluded and why (n_excluded, never treated as zero), that absent months are omitted with a reason code (not_computed_yet, definition_break), that only published reporters answer, that correlations are null with a reason below 12 common months, and the limit cap of 200. It also discloses provenance and the interpretive limits (not official figures, not causal, not a forecast).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is dense and valuable but delivered as one long run-on paragraph with repeated hedging ('not a forecast and not a cause', 'not investment advice, a credit rating or a trading recommendation', 'not official figures'). The field definitions, sampling rules, limits and disclaimers are interleaved rather than grouped, making it hard to scan. The purpose is front-loaded, but the back half does not earn its length.

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?

There is no output schema, so the description must define the return shape, and it does: share_up_by_count, share_up_by_value, share_accelerating, total_yoy, n_items, n_excluded, notes, plus the synchrony block and its pairs structure. For a 9-parameter analytical tool with two distinct modes, nothing an agent needs in order to call it correctly or read the result is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description goes further by stating defaults and cross-parameter constraints together (level default hs4, parent only with hs4/hs6, window 3 or 12 default 12, newest-first limit default 36 max 200) and by explaining the two mutually exclusive request shapes, reporter vs reporters. It adds modest meaning beyond the schema, mostly by restating constraints in readable form.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise, quantified statement of what is computed (per-month share of items whose latest 3- or 12-month window exceeds the same months a year earlier) and names each returned field. An agent can tell this is a breadth/diffusion measure rather than a level or ranking tool. It stops short of naming a specific sibling to prefer or avoid, so differentiation is by concept rather than by explicit routing.

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?

It gives an explicit use case ('whether a rise in imports is broad or driven by a few items') and spells out the alternative operating mode: use 'reporters' (2-4 countries, hs2 only) instead of 'reporter' for cross-country synchrony questions. It also states exclusions, e.g. hs2 changes across an HS version change can be distorted. Missing only explicit hand-offs to named sibling tools within the description itself.

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