Skip to main content
Glama

Census Imports

census_imports
Read-onlyIdempotent

Search US import data by HS commodity code and/or country. Returns import values, quantities, and commodity details. Pass country as a plain English name (e.g. "China"). Omit hs_code for total imports from a country; omit country for all countries combined.

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": {
      "year": "2024",
      "country": "European Union",
      "hs_code": "30"
    },
    "name": "census_imports"
  }
}

Input Schema

NameRequiredDescriptionDefault
yearYesTrade year (e.g., "2024")
limitNoMaximum number of records to return (default 20)
monthNoTrade month 01-12 (e.g., "06" for June). Optional, omit for annual data.
countryNoCountry name in plain English (e.g., "Mexico", "South Korea", "European Union"). Preferred over country_code, this is resolved for you. Optional, omit for all countries combined.
hs_codeNoHS commodity code at 2, 4, or 6 digit level (e.g., "8471" for computers, "87" for vehicles). Optional, omit for total imports across all commodities.
country_codeNoCensus Schedule C country code if you already have one (e.g., "5700" China, "2010" Mexico). NOT an ISO code, "MX" and "CN" will not work. Prefer `country` and pass a name instead. Optional.

Output Schema

NameRequiredDescriptionDefault
typeYesTrade direction indicator
countYesNumber of records returned
periodYesTrade period (year or year-month)
hs_codeYesHS commodity code queried
recordsYes

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\", \"South Korea\", \"European Union\"). Preferred over country_code — this is resolved for you. Optional — omit for all countries combined."New value: +"Country name in plain English (e.g., \"Mexico\", \"South Korea\", \"European Union\"). Preferred over country_code, this is resolved for you. Optional, omit for all countries combined."
    • changedInput schema / properties / country_code / description
      Previous value: -"Census Schedule C country code if you already have one (e.g., \"5700\" China, \"2010\" Mexico). NOT an ISO code — \"MX\" and \"CN\" will not work. Prefer `country` and pass a name instead. Optional."New value: +"Census Schedule C country code if you already have one (e.g., \"5700\" China, \"2010\" Mexico). NOT an ISO code, \"MX\" and \"CN\" will not work. Prefer `country` and pass a name instead. Optional."
    • changedInput schema / properties / hs_code / description
      Previous value: -"HS commodity code at 2, 4, or 6 digit level (e.g., \"8471\" for computers, \"87\" for vehicles). Optional — omit for total imports across all commodities."New value: +"HS commodity code at 2, 4, or 6 digit level (e.g., \"8471\" for computers, \"87\" for vehicles). Optional, omit for total imports across all commodities."
    • changedInput schema / properties / month / description
      Previous value: -"Trade month 01-12 (e.g., \"06\" for June). Optional — omit for annual data."New value: +"Trade month 01-12 (e.g., \"06\" for June). Optional, omit for annual data."
  2. Changed3 schema fields changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "hs_code": "8471",
      -    "year": "2024"
      -  },
      -  {
      -    "country_code": "5700",
      -    "hs_code": "87",
      -    "limit": 50,
      -    "month": "06",
      -    "year": "2023"
      -  }
      -]New value: +[
      +  {
      +    "country": "European Union",
      +    "hs_code": "30",
      +    "year": "2024"
      +  },
      +  {
      +    "hs_code": "8471",
      +    "year": "2024"
      +  },
      +  {
      +    "country_code": "5700",
      +    "hs_code": "87",
      +    "limit": 50,
      +    "month": "06",
      +    "year": "2023"
      +  }
      +]
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "Country name in plain English (e.g., \"Mexico\", \"South Korea\", \"European Union\"). Preferred over country_code — this is resolved for you. Optional — omit for all countries combined.",
      +  "type": "string"
      +}
    • changedInput schema / properties / country_code / description
      Previous value: -"Census country code (e.g., \"5700\" for China, \"2010\" for Mexico). Optional — omit for all countries."New value: +"Census Schedule C country code if you already have one (e.g., \"5700\" China, \"2010\" Mexico). NOT an ISO code — \"MX\" and \"CN\" will not work. Prefer `country` and pass a name instead. Optional."
  3. Changed2 schema fields changed
    • changedInput schema / properties / hs_code / description
      Previous value: -"HS commodity code at 2, 4, or 6 digit level (e.g., \"8471\" for computers, \"87\" for vehicles)"New value: +"HS commodity code at 2, 4, or 6 digit level (e.g., \"8471\" for computers, \"87\" for vehicles). Optional — omit for total imports across all commodities."
    • changedInput schema / required
      Previous value: -[
      -  "hs_code",
      -  "year"
      -]New value: +[
      +  "year"
      +]
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "count": {
      +      "description": "Number of records returned",
      +      "type": "number"
      +    },
      +    "hs_code": {
      +      "description": "HS commodity code queried",
      +      "type": "string"
      +    },
      +    "period": {
      +      "description": "Trade period (year or year-month)",
      +      "type": "string"
      +    },
      +    "records": {
      +      "items": {
      +        "properties": {
      +          "commodity_code": {
      +            "description": "HS commodity code",
      +            "type": "string"
      +          },
      +          "country_code": {
      +            "description": "Census country code",
      +            "type": "string"
      +          },
      +          "country_name": {
      +            "description": "Country name",
      +            "type": "string"
      +          },
      +          "import_value_usd": {
      +            "description": "Import value in USD",
      +            "type": "number"
      +          },
      +          "period": {
      +            "description": "Trade period",
      +            "type": "string"
      +          },
      +          "quantity": {
      +            "description": "Import quantity",
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "commodity_code",
      +          "country_code",
      +          "country_name",
      +          "import_value_usd",
      +          "quantity",
      +          "period"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "type": {
      +      "description": "Trade direction indicator",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "hs_code",
      +    "period",
      +    "count",
      +    "records"
      +  ],
      +  "type": "object"
      +}
  5. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "hs_code": "8471",
      +    "year": "2024"
      +  },
      +  {
      +    "country_code": "5700",
      +    "hs_code": "87",
      +    "limit": 50,
      +    "month": "06",
      +    "year": "2023"
      +  }
      +]
  6. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world behavior, so the safety profile is covered. The description adds genuine context beyond that: that a plain-English country name is resolved server-side, and that omission of a filter changes the aggregation level. It omits data-lag/currency context, which keeps it from a 5.

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?

Four short sentences, each doing distinct work: purpose, return content, country-name format, and the two omission rules for aggregation. Scope and format guidance are front-loaded with no filler.

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 an output schema present and rich annotations, the description needn't explain return shape, and it correctly focuses on the non-obvious input conventions. The only meaningful gap is that it says nothing about data recency, units, or limits, which matter for trade statistics.

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 every parameter is already documented in the input schema, including the 'preferred over country_code' note and the omit-for-totals semantics. The description restates those points compactly rather than adding new meaning, so the baseline 3 applies.

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?

States a specific verb and resource ('Search US import data') plus the two key filter dimensions (HS commodity code, country) and what comes back (import values, quantities, commodity details). The word 'imports' implicitly separates it from census_exports and census_trade_balance, but no sibling is named, so it falls just short of a 5.

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?

Gives concrete usage patterns: 'Omit hs_code for total imports from a country; omit country for all countries combined' tells an agent exactly how to get aggregate vs. filtered results. It does not explicitly route between this tool and the other census_* siblings, so it stops at clear context without exclusions.

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.