Skip to main content
Glama

get_customs_commodity_trade

Read-onlyIdempotent

Query China import or export observations by recorded major-commodity label. Inputs: period, commodity, flow and optional metric. Selected exact Chinese aliases and normalized existing names are supported; this is not general translation or HS-code classification. Returns trade_value or quantity observations with original commodity labels, units, scope, source_class, provenance, snapshot, pagination and limits. No category merging or conversion. No match returns an empty data array. Required: period, commodity, flow. Missing required or invalid input produces an argument error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowYesChina trade direction: IMPORT or EXPORT. Required.
limitNoMaximum number of records returned. Integer 1–100; default 20. A page may contain fewer records.
metricNoRecorded metric trade_value or quantity. trade_value currently uses 1000USD; quantity units vary by commodity and are returned unchanged. Optional; omission includes both collected metrics.
offsetNoZero-based pagination offset. Integer 0–999; default 0. Offsets of 1000 or greater are rejected. Use the returned next_offset when present.
periodYesRecorded statistical period: YYYY-MM for a single month, or YYYY-01/YYYY-MM for January-to-month cumulative observations. Exact collected period; these periods are not interchangeable. A snapshot identifies the dataset version, not a selectable statistical period. Required.
snapshotNoOptional expected snapshot.version, not a historical-version selector. If omitted, the current dataset snapshot is used. For continued pagination reuse the previous response snapshot.version; a mismatch is rejected.
commodityYesRecorded major-commodity name or a selected exact Chinese alias. Existing literal substring matching remains; known aliases resolve only to their exact canonical label. NFKC, leading/trailing spaces and letter case are normalized for known names. No fuzzy translation, HS mapping or broader/narrower category expansion. Required.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / commodity / description
      Previous value: -"Recorded commodity name or category text. Literal, case-sensitive substring match; no fuzzy search. Non-empty string, at most 256 characters; control characters are not accepted. Required. Supplied filters are combined with AND."New value: +"Recorded major-commodity name or a selected exact Chinese alias. Existing literal substring matching remains; known aliases resolve only to their exact canonical label. NFKC, leading/trailing spaces and letter case are normalized for known names. No fuzzy translation, HS mapping or broader/narrower category expansion. Required."
    • changedInput schema / properties / flow / description
      Previous value: -"Recorded trade-flow label. Exact match. Allowed values: IMPORT, EXPORT. Non-empty string, at most 256 characters; control characters are not accepted. Required. Supplied filters are combined with AND."New value: +"China trade direction: IMPORT or EXPORT. Required."
    • changedInput schema / properties / metric / description
      Previous value: -"Statistical measure label exactly as recorded; no unit conversion or aggregation. Exact match. Non-empty string, at most 256 characters; control characters are not accepted. Optional; omitted means no filter on this field. Supplied filters are combined with AND."New value: +"Recorded metric trade_value or quantity. trade_value currently uses 1000USD; quantity units vary by commodity and are returned unchanged. Optional; omission includes both collected metrics."
    • changedInput schema / properties / period / description
      Previous value: -"Statistical period label exactly as recorded; no date-range parsing or automatic period conversion. Exact match. Non-empty string, at most 256 characters; control characters are not accepted. Required. Supplied filters are combined with AND."New value: +"Recorded statistical period: YYYY-MM for a single month, or YYYY-01/YYYY-MM for January-to-month cumulative observations. Exact collected period; these periods are not interchangeable. A snapshot identifies the dataset version, not a selectable statistical period. Required."
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, but the description adds substantial behavioral context: return fields, pagination and limits, snapshot semantics ('not a historical-version selector'), empty-array behavior on no match, and argument-error on invalid input. This goes well beyond the structured annotations and is not contradicted.

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?

The description is moderately long but well-structured, front-loading the core purpose and then covering inputs, returns, limitations, required fields, and errors in logical order. Each sentence adds information; there is little redundancy, though it could be tightened by merging the required-fields sentence into the input sentence.

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?

With 7 parameters, no output schema, and no annotations for return structure, the description does a good job of covering return fields, pagination, snapshot behavior, edge cases, and required inputs. It lacks explicit guidance on when to use sibling tools, which is a minor gap given the complexity, but the tool's scope is clearly bounded.

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 the baseline is 3. The description repeats required fields and briefly mentions aliases, but it does not add significant parameter-level meaning beyond what the schema already documents (e.g., commodity matching behavior is described in the schema as 'Recorded major-commodity name or a selected exact Chinese alias'). The limitation on fuzzy translation is more behavioral than parameter-semantic.

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 description opens with a specific verb ('Query') and resource ('China import or export observations'), scoped by 'recorded major-commodity label.' It clearly distinguishes itself from translation/HS-code tools and implicitly differentiates from siblings focused on country trade, investment, or MOFCOM stats.

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?

The description states when to use the tool (for exact commodity labels with optional metric) and explicitly what it does NOT do ('not general translation or HS-code classification', 'No category merging or conversion'). However, it does not name any sibling tools or provide explicit conditions for choosing between them, relying on implicit differentiation from the resource type.

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