New Your team’s decisions, in one playbook every coding agent works from. Never answer your agent twice

comtrade.trade.query

Query international merchandise trade statistics from the UN Comtrade database. Returns up to 500 records of imports and/or exports for a specific reporting country, reference period, commodity code, and partner country. Data covers 200+ reporter countries from 1962 (annual) and 2010 (monthly). V...

SERVERApibase SOURCEapibase-mcp-client
Low RISK CLASS
Category Read
Parameters 123 required
Recommended Allowedsee the rule below
Registry record Grade F, identity unverified Pull the record →

This record as markdown: /tools/io-github-whiteknightonhorse-apibase/comtrade.trade.query.md

What comtrade.trade.query does on Apibase

AI agents call comtrade.trade.query to retrieve information from Apibase without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

ParameterTypeRequiredDescription
period string Yes Reference period to query. Annual: 4-digit year (e.g. "2022"). Monthly: YYYYMM (e.g. "202209" for Sep 2022). Comma-separated for multiple periods (e.g. "2020,20
cmd_code string — Commodity code filter. Use HS codes (e.g. "84" for machinery, "27" for petroleum, "TOTAL" for aggregate totals, "AG2" for all 2-digit chapters). Omit to return
flow_code string Yes Trade flow direction. M=Imports, X=Exports, MX=Both imports and exports, RM=Re-imports, RX=Re-exports.
freq_code string — Frequency. A=Annual (default), M=Monthly.
type_code string — Trade data type. C=Commodities (default), S=Services.
max_records integer — Maximum number of records to return (1–500). Default 100. The public preview API is capped at 500 records per request.
aggregate_by string — Aggregate results by a dimension. Valid values: "cmdCode", "flowCode", "partnerCode", "reporterCode", "period". Omit to return unaggregated records.
customs_code string — Customs procedure code filter (e.g. "C00"=all procedures, "C03"=outright export, "C04"=warehousing). Omit for all procedures.
partner_code integer — UN numeric code for the partner country. 0=World aggregate (all partners combined). Omit to return all individual partners.
partner2_code integer — Secondary partner code for extended trade flow tracking (consignment country). 0=World aggregate. Omit to use the default world aggregate.
reporter_code integer Yes UN numeric code for the reporting country (e.g. 276=Germany, 840=USA, 156=China, 826=UK). Use comtrade.reporters to look up codes.
classification string — Commodity classification system. HS=Harmonized System (default, most common). B4/B5=BEC, EB=EBOPS services, S1-S4/SS=SITC revisions.

Parameters from the server's own tool schema.

Why comtrade.trade.query is rated Low

Tool retrieves historical trade data from public UN database with no side effects or modifications.

From the tool's definition Query international merchandise trade statistics, returns up to 500 records, retrieves data

Risk signalsHigh parameter count (12 properties)

Questions about comtrade.trade.query

What does the comtrade.trade.query tool do? +

Query international merchandise trade statistics from the UN Comtrade database. Returns up to 500 records of imports and/or exports for a specific reporting country, reference period, commodity code, and partner country. Data covers 200+ reporter countries from 1962 (annual) and 2010 (monthly). Values in USD (primary value), CIF for imports, FOB for exports. Commodities classified by Harmonized System (HS) or SITC. Use reporter_code from comtrade.reporters, HS chapter codes (e.g. "84" for machinery, "27" for petroleum, "85" for electronics), and flow_code M=imports, X=exports. Source: UN Comtrade public preview API, no auth, 500 calls/day free. It is categorised as a Read tool in the Apibase MCP Server, which means it retrieves data without modifying state.

What parameters does comtrade.trade.query accept? +

comtrade.trade.query accepts 12 parameters: period, cmd_code, flow_code, freq_code, type_code, max_records, aggregate_by, customs_code, partner_code, partner2_code, reporter_code, classification. Required: period, flow_code, reporter_code. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on comtrade.trade.query? +

Register the Apibase MCP server in PolicyLayer and add a rule for comtrade.trade.query: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Apibase. Nothing to install.

What risk level is comtrade.trade.query? +

comtrade.trade.query is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit comtrade.trade.query? +

Yes. Add a rate_limit block to the comtrade.trade.query rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block comtrade.trade.query completely? +

Set action: deny in the PolicyLayer policy for comtrade.trade.query. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides comtrade.trade.query? +

comtrade.trade.query is provided by the Apibase MCP server (apibase-mcp-client). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

More on Apibase, and thousands of servers like it.

Across the catalogue

// THE MCP REGISTRY

PolicyLayer tracks 44,603 MCP servers and 515,000+ tools.

Every server has a live record: who publishes it, whether it answers without auth, its risk grade, every tool classified, the recommended policy. This page is one line of Apibase's. Pull the full record:

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.