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.

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": "China"
    },
    "name": "census_trade_balance"
  }
}

Input 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

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. Changed1 schema field changed
    • changedInput schema / properties / country / description
      Previous value: -"Country name in plain English (e.g., \"Mexico\", \"China\"). Preferred — resolved for you. Pass this OR country_code."New value: +"Country name in plain English (e.g., \"Mexico\", \"China\"). Preferred, resolved for you. Pass this OR country_code."
  2. 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"
      +]
  3. 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"
      +}
  4. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "country_code": "5700",
      +    "year": "2024"
      +  },
      +  {
      +    "country_code": "2010",
      +    "year": "2023"
      +  }
      +]
  5. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare read-only, open-world, idempotent, and non-destructive behavior, so safety is covered. The description adds that the result contains net trade value plus an end-use commodity breakdown, which is useful output context, but it does not disclose rate limits, data coverage caveats, or authentication requirements. Since the output schema exists, this added return-value note is modest but appropriate.

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?

Two sentences, no filler, with the purpose and return content front-loaded. It is appropriately sized for a simple lookup tool.

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 read-only lookup with full schema coverage and an output schema, the definition covers the essential purpose and return shape. It leaves sibling routing unaddressed, but given the annotations and schema richness, nothing critical for invocation is missing.

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%, and the schema itself explains year, country name preference, and Schedule C country code. The description only restates country/year at a high level and adds no parameter meaning beyond the schema, so baseline 3 is appropriate.

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 states a specific verb and resource: check the US trade balance for a named country and year, and it names the return values. It is clear what the tool does, but it does not differentiate itself from siblings such as census_exports, census_imports, or census_trade_trends, so it falls 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 Guidelines3/5

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

It gives an implied usage context (bilateral trade balance for a given year) but never states when to choose this over census_exports, census_imports, or census_trade_trends, nor does it list exclusions or preconditions. The agent must infer the selection rule.

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.