Skip to main content
Glama

get_mofcom_trade_stats

Read-onlyIdempotent

Query collected country-workbook trade observations (flows relative to the named reporting country) or China–Portuguese-speaking-country bilateral year-to-date observations. Inputs: period and optional country, flow and metric. This collection is not China national all-partner monthly totals. Returns original structured observations, units, scope, source_class, provenance, snapshot, pagination and limits. No conversion, aggregation or cross-period calculation. No match returns an empty data array. Required: period. Missing required or invalid input produces an argument error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowNoFlow relative to the named reporting country for COUNTRY_WORKBOOK_AS_REPORTED; China flow relative to the named partner for CHINA_PORTUGUESE_COUNTRIES_YTD. Recorded values IMPORT, EXPORT or BOTH; scope remains in each fact. Optional.
limitNoMaximum number of records returned. Integer 1–100; default 20. A page may contain fewer records.
metricNoRecorded metric trade_value; country workbook unit is 亿美元, China–Portuguese-speaking-partner unit is 万美元. No unit conversion. Optional.
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.
countryNoReporting country in country workbooks, or China bilateral partner in Portuguese-speaking-country observations; returned scope distinguishes them. Exact recorded name or a documented one-to-one alias. Optional.
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / country / description
      Previous value: -"Country or region label exactly as recorded; no country-code or alias conversion. 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: +"Reporting country in country workbooks, or China bilateral partner in Portuguese-speaking-country observations; returned scope distinguishes them. Exact recorded name or a documented one-to-one alias. Optional."
    • changedInput schema / properties / flow / description
      Previous value: -"Recorded trade-flow label. 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: +"Flow relative to the named reporting country for COUNTRY_WORKBOOK_AS_REPORTED; China flow relative to the named partner for CHINA_PORTUGUESE_COUNTRIES_YTD. Recorded values IMPORT, EXPORT or BOTH; scope remains in each fact. Optional."
    • 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; country workbook unit is 亿美元, China–Portuguese-speaking-partner unit is 万美元. No unit conversion. Optional."
    • 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

A3.7/5.0
Behavior4/5

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

The description goes beyond the annotations by detailing the return payload (units, scope, source_class, provenance, snapshot, pagination, limits), stating that no conversion/aggregation/cross-period calculation occurs, and describing behavior on no match (empty array) and errors. This adds significant behavioral context beyond the readOnly and idempotent hints.

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 concise and front-loaded with the primary purpose, followed by inputs, exclusions, return behavior, and error handling. Each sentence serves a clear function, and there is no redundancy or filler. It is appropriately sized for a query tool with several parameters.

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?

Given there is no output schema, the description compensates by specifying return fields and pagination limits, and clarifies error and no-match behavior. It also explains the required period and the distinction between periods and snapshots. The description is largely complete for an agent to use the tool correctly, though it could benefit from a brief mention of how it differs from the sibling trade tools.

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 all parameters are already described in the schema. The description only mentions 'period and optional country, flow and metric' without adding new semantic detail; it does note that periods are not interchangeable, which is also present in the schema. The description adds little beyond the schema for parameter understanding.

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 clearly states the tool queries trade observations from two distinct collections (country-workbook and China–Portuguese-speaking-country bilateral), and explicitly notes it is not China national all-partner monthly totals. It names the verb 'Query' and the resource 'trade observations', but does not explicitly differentiate from sibling tools like get_customs_country_trade, which also handle trade data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context on what data is included (country-workbook and bilateral observations) and excludes China national monthly totals, but it does not offer explicit guidance on when to use this tool versus the sibling tools. The exclusion hints at scope but no alternatives are named or conditions given for switching.

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