Skip to main content
Glama

Census Trade Trends

census_trade_trends
Read-onlyIdempotent

Monthly US trade trends with ONE trading partner, month-by-month imports and exports for a country, optionally narrowed to an HS commodity, to show seasonality and shifts. A country is required: an unfiltered monthly query spans every partner and the Census API cannot return it in time. For all-countries totals use census_imports / census_exports instead.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "country": "China",
      "end_year": "2024",
      "start_year": "2024"
    },
    "name": "census_trade_trends"
  }
}

Input Schema

NameRequiredDescriptionDefault
countryNoCountry name in plain English (e.g., "Mexico"). Preferred, resolved for you. REQUIRED unless you pass country_code.
hs_codeNoHS commodity code. Optional, omit for aggregate trade.
end_yearNoEnd year (e.g., "2024"). Optional, defaults to the last fully-published year (last calendar year; Census publishes on a lag).
start_yearNoStart year (e.g., "2022"). Optional, defaults to the same year as end_year, i.e. a single year. Maximum span 3 years.
country_codeNoCensus Schedule C country code (e.g. "5700" China, "2010" Mexico). NOT an ISO code. Prefer `country`. Satisfies the country requirement.

Output Schema

NameRequiredDescriptionDefault
monthsYesNumber of monthly data points
trendsYes
countryYesResolved country name as Census reports it, or 'all' for all countries
hs_codeYesHS commodity code or 'all' for aggregate
end_yearYesEnd year of trend range
start_yearYesStart year of trend range
country_codeYesCensus country code or 'all' for all countries

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / country / description
      Previous value: -"Country name in plain English (e.g., \"Mexico\"). Preferred — resolved for you. REQUIRED unless you pass country_code."New value: +"Country name in plain English (e.g., \"Mexico\"). Preferred, resolved for you. REQUIRED unless you pass country_code."
    • changedInput schema / properties / end_year / description
      Previous value: -"End year (e.g., \"2024\"). Optional — defaults to the last fully-published year (last calendar year; Census publishes on a lag)."New value: +"End year (e.g., \"2024\"). Optional, defaults to the last fully-published year (last calendar year; Census publishes on a lag)."
    • changedInput schema / properties / hs_code / description
      Previous value: -"HS commodity code. Optional — omit for aggregate trade."New value: +"HS commodity code. Optional, omit for aggregate trade."
    • changedInput schema / properties / start_year / description
      Previous value: -"Start year (e.g., \"2022\"). Optional — defaults to the same year as end_year, i.e. a single year. Maximum span 3 years."New value: +"Start year (e.g., \"2022\"). Optional, defaults to the same year as end_year, i.e. a single year. Maximum span 3 years."
  2. Changed5 schema fields changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "end_year": "2024",
      -    "start_year": "2022"
      -  },
      -  {
      -    "country_code": "5700",
      -    "end_year": "2024",
      -    "hs_code": "8471",
      -    "start_year": "2021"
      -  }
      -]New value: +[
      +  {
      +    "country": "China",
      +    "end_year": "2024",
      +    "start_year": "2024"
      +  },
      +  {
      +    "country": "China",
      +    "end_year": "2025",
      +    "hs_code": "85",
      +    "start_year": "2025"
      +  }
      +]
    • changedInput schema / properties / country / description
      Previous value: -"Country name in plain English (e.g., \"Mexico\"). Preferred — resolved for you. Optional — omit for all countries."New value: +"Country name in plain English (e.g., \"Mexico\"). Preferred — resolved for you. REQUIRED unless you pass country_code."
    • changedInput schema / properties / country_code / description
      Previous value: -"Census Schedule C country code. NOT an ISO code. Prefer `country`. Optional."New value: +"Census Schedule C country code (e.g. \"5700\" China, \"2010\" Mexico). NOT an ISO code. Prefer `country`. Satisfies the country requirement."
    • changedInput schema / properties / end_year / description
      Previous value: -"End year (e.g., \"2024\"). Optional — defaults to the last fully-published year if omitted."New value: +"End year (e.g., \"2024\"). Optional — defaults to the last fully-published year (last calendar year; Census publishes on a lag)."
    • changedInput schema / properties / start_year / description
      Previous value: -"Start year (e.g., \"2022\"). Optional — defaults to a 3-year window ending at the last fully-published year if omitted."New value: +"Start year (e.g., \"2022\"). Optional — defaults to the same year as end_year, i.e. a single year. Maximum span 3 years."
  3. Changed2 schema fields changed
    • addedOutput schema / properties / country
      Added value: +{
      +  "description": "Resolved country name as Census reports it, or 'all' for all countries",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "start_year",
      -  "end_year",
      -  "hs_code",
      -  "country_code",
      -  "months",
      -  "trends"
      -]New value: +[
      +  "start_year",
      +  "end_year",
      +  "hs_code",
      +  "country",
      +  "country_code",
      +  "months",
      +  "trends"
      +]
  4. Changed3 schema fields changed
    • changedInput schema / properties / end_year / description
      Previous value: -"End year (e.g., \"2024\")"New value: +"End year (e.g., \"2024\"). Optional — defaults to the last fully-published year if omitted."
    • changedInput schema / properties / start_year / description
      Previous value: -"Start year (e.g., \"2022\")"New value: +"Start year (e.g., \"2022\"). Optional — defaults to a 3-year window ending at the last fully-published year if omitted."
    • changedInput schema / required
      Previous value: -[
      -  "start_year",
      -  "end_year"
      -]New value: +[]
  5. Changed2 schema fields changed
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "Country name in plain English (e.g., \"Mexico\"). Preferred — resolved for you. Optional — omit for all countries.",
      +  "type": "string"
      +}
    • changedInput schema / properties / country_code / description
      Previous value: -"Census country code. Optional — omit for all countries."New value: +"Census Schedule C country code. NOT an ISO code. Prefer `country`. Optional."
  6. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "country_code": {
      +      "description": "Census country code or 'all' for all countries",
      +      "type": "string"
      +    },
      +    "end_year": {
      +      "description": "End year of trend range",
      +      "type": "string"
      +    },
      +    "hs_code": {
      +      "description": "HS commodity code or 'all' for aggregate",
      +      "type": "string"
      +    },
      +    "months": {
      +      "description": "Number of monthly data points",
      +      "type": "number"
      +    },
      +    "start_year": {
      +      "description": "Start year of trend range",
      +      "type": "string"
      +    },
      +    "trends": {
      +      "items": {
      +        "properties": {
      +          "balance_usd": {
      +            "description": "Trade balance in USD for period",
      +            "type": "number"
      +          },
      +          "exports_usd": {
      +            "description": "Export value in USD for period",
      +            "type": "number"
      +          },
      +          "imports_usd": {
      +            "description": "Import value in USD for period",
      +            "type": "number"
      +          },
      +          "period": {
      +            "description": "Month-year period",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "period",
      +          "imports_usd",
      +          "exports_usd",
      +          "balance_usd"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "start_year",
      +    "end_year",
      +    "hs_code",
      +    "country_code",
      +    "months",
      +    "trends"
      +  ],
      +  "type": "object"
      +}
  7. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "end_year": "2024",
      +    "start_year": "2022"
      +  },
      +  {
      +    "country_code": "5700",
      +    "end_year": "2024",
      +    "hs_code": "8471",
      +    "start_year": "2021"
      +  }
      +]
  8. First observed

TDQS

A4.7/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is covered. The description adds real behavioral context beyond them: an unfiltered monthly query spans every partner and 'the Census API cannot return it in time', which warns the agent about a hard failure mode. It does not mention the 3-year span cap or response shape in prose, but those are carried by the schema and output schema.

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

Conciseness5/5

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

Three sentences, front-loaded with the capability and immediately followed by the constraint and the alternative. Every clause earns its place; there is no restatement of the title or filler.

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?

An output schema exists, so return values need no prose explanation, and all five parameters are fully described in the schema. What remains for the description — partner scoping, why the filter is mandatory, and which sibling handles the aggregate case — is all present.

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 and the schema already documents country, country_code, hs_code and the year bounds. The description still adds meaning by explaining why country is effectively mandatory (API timeout) and by characterizing hs_code as an optional narrowing dimension for seasonality analysis, rather than merely restating field names.

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 gives a specific verb and resource (monthly US trade trends, month-by-month imports and exports) plus a hard scope boundary: exactly ONE trading partner, optionally narrowed to an HS commodity. It also names what it is not (an unfiltered all-partner query), which lets an agent separate it from census_imports / census_exports without opening any schema.

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

Usage Guidelines5/5

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

It states the selection condition explicitly ('A country is required') and routes the agent to the correct alternative for the all-countries case ('use census_imports / census_exports instead'). That is when-to-use, when-not-to-use, and the named alternative in three sentences.

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.