Skip to main content
Glama

TradeStats - customs trade statistics

get_item_ports

Through which ports an item came in or went out, over a period you name (default the newest 12 months): for each port its value, its share of the item's total, the same months a year earlier and the change, the shipping weight where the source gives one, and (for the US) the value by method of transport. Optionally for one partner country; default all partners together. Ports are the source's own ports or customs offices, at the finest code the source gives ports for (see get_catalog, "ports": the US has them at HS6); a code above or below that level, or a reporter without port detail, gets the error port_unavailable. A port whose value the source hides is null with a reason, never 0. The ports are the entry or exit point of the goods, not their origin or destination. Use this tool when asked through which port, customs office or entry point an item came in or went out.

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": {
      "reporter": "<reporter>",
      "flow": "<flow>",
      "code": "<code>"
    },
    "name": "get_item_ports"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoOptional last month, YYYY-MM. Default: the latest published month.
codeYesRequired. The code at the level the reporter has port detail for (US: HS6, 6 digits); dots are ignored.
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. Default: 11 months before the last.
limitNoOptional. Ports shown, the largest first (default 20).
countryNoOptional partner country (ISO alpha-2 code or name); omit for all partners together.
reporterYesRequired. The reporting country whose customs statistics are read: "JP" (Japan), "US" (United States), "GB" (United Kingdom) or "EU" (European Union (27 member states)). Partners are the other countries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/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: it names the failure mode (port_unavailable for a code above or below the available level, or a reporter without port detail), the null-with-reason convention for hidden values instead of 0, and the conceptual boundary that ports are entry/exit points, not origin or destination. It also states the default window of the newest 12 months.

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 and period are front-loaded, and nearly every clause adds a fact about returns, errors, or scope. It is dense to the point of being a single run-on paragraph, so return-field detail and port-level caveats are harder to scan than a short list would be, but there is little filler to cut.

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 convey what comes back, and it does: per-port value, share of the item total, prior-year months and change, shipping weight where available, and US transport-method value. Combined with defaults, partner scoping, and error semantics for a 7-parameter tool, an agent has everything needed to call it correctly.

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 schema already documents all seven parameters, making the baseline 3. The description nonetheless adds meaning the schema does not: it explains that the code must sit at the level the reporter publishes ports for, cites get_catalog and the US HS6 example, and ties an off-level code to the port_unavailable error.

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 opening clause names a specific resource and relationship: ports through which an item came in or went out, with the period scoping stated immediately. The final sentence repeats the trigger phrased as a user question ('through which port, customs office or entry point'), which makes the tool unmistakable against siblings like get_partners or get_transport_mode.

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 trigger sentence and explicitly routes away from alternatives in the flow parameter text ('for a comparison across countries use compare_countries, for exports minus imports use get_balance'). It also points to get_catalog for port-level availability. What is missing is a direct exclusion versus get_transport_mode, which overlaps with the US method-of-transport content mentioned here.

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