Skip to main content
Glama

Census Trade Balance

census_trade_balance
Read-onlyIdempotent

Check US trade balance with a specific country for a given year. Returns net trade value and breakdown by end-use commodity category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesTrade year (e.g., "2024")
countryNoCountry name in plain English (e.g., "Mexico", "China"). Preferred — resolved for you. Pass this OR country_code.
country_codeNoCensus Schedule C country code (e.g., "5700" China, "2010" Mexico). NOT an ISO code. Prefer `country`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesTrade year
countryYesCountry name
country_codeYesCensus country code
total_exports_usdYesTotal exports in USD
total_imports_usdYesTotal imports in USD
trade_balance_usdYesNet trade balance (exports minus imports)
deficit_or_surplusYesTrade balance classification

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "country_code": "5700",
      -    "year": "2024"
      -  },
      -  {
      -    "country_code": "2010",
      -    "year": "2023"
      -  }
      -]New value: +[
      +  {
      +    "country": "China",
      +    "year": "2024"
      +  },
      +  {
      +    "country_code": "5700",
      +    "year": "2024"
      +  },
      +  {
      +    "country_code": "2010",
      +    "year": "2023"
      +  }
      +]
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "Country name in plain English (e.g., \"Mexico\", \"China\"). Preferred — resolved for you. Pass this OR country_code.",
      +  "type": "string"
      +}
    • changedInput schema / properties / country_code / description
      Previous value: -"Census country code (e.g., \"5700\" for China, \"2010\" for Mexico)"New value: +"Census Schedule C country code (e.g., \"5700\" China, \"2010\" Mexico). NOT an ISO code. Prefer `country`."
    • changedInput schema / required
      Previous value: -[
      -  "country_code",
      -  "year"
      -]New value: +[
      +  "year"
      +]
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "country": {
      +      "description": "Country name",
      +      "type": "string"
      +    },
      +    "country_code": {
      +      "description": "Census country code",
      +      "type": "string"
      +    },
      +    "deficit_or_surplus": {
      +      "description": "Trade balance classification",
      +      "enum": [
      +        "surplus",
      +        "deficit"
      +      ],
      +      "type": "string"
      +    },
      +    "total_exports_usd": {
      +      "description": "Total exports in USD",
      +      "type": "number"
      +    },
      +    "total_imports_usd": {
      +      "description": "Total imports in USD",
      +      "type": "number"
      +    },
      +    "trade_balance_usd": {
      +      "description": "Net trade balance (exports minus imports)",
      +      "type": "number"
      +    },
      +    "year": {
      +      "description": "Trade year",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "country",
      +    "country_code",
      +    "year",
      +    "total_imports_usd",
      +    "total_exports_usd",
      +    "trade_balance_usd",
      +    "deficit_or_surplus"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "country_code": "5700",
      +    "year": "2024"
      +  },
      +  {
      +    "country_code": "2010",
      +    "year": "2023"
      +  }
      +]
  4. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already provide strong safety signals (readOnlyHint, idempotentHint, destructiveHint=false). The description adds useful context about the return value (breakdown by end-use commodity category) but does not disclose additional behavioral traits such as data limitations or filtering behavior. It is consistent with annotations, no contradiction.

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?

The description is two sentences, front-loaded with the core action ('Check US trade balance'), then specifies output details. Every word is informative; there is no redundancy or fluff.

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?

For a simple query tool with full schema coverage, an output schema, and detailed annotations, the description is complete enough. It states the core functionality and expected returns. It does not mention data source limitations or country-code alternatives, but these are covered by the schema and annotations, so the description does not need to repeat them.

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 adds general context about using a 'specific country' and 'given year', but does not elaborate on parameter syntax, precedence, or formatting beyond what the schema already provides. It meets the baseline without adding significant extra semantic value.

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 uses a specific verb ('Check') and clearly identifies the resource (US trade balance for a country/year) and the output (net trade value and breakdown by end-use commodity category). This distinguishes it from sibling tools like census_exports and census_imports, which focus on individual flows rather than net balance.

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 clearly states when to use the tool: to check US trade balance with a specific country for a given year. It does not explicitly name alternatives or exclusions (e.g., 'use census_exports for exports only'), but the context is clear enough for an agent to infer the appropriate use case.

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.