Skip to main content
Glama
jslagle9

census-trade-mcp-server

by jslagle9

Look Up Census Trade CTY_CODE

census_trade_lookup_country_code
Read-onlyIdempotent

Translate a country or trade-bloc name into the Census CTY_CODE needed to filter export/import data.

Instructions

Look up the Census Bureau Schedule C CTY_CODE (and country groupings like OPEC, NAFTA, European Union, or world regions) needed to filter census_trade_query_exports/imports by country.

The Census API filters trade data by a numeric CTY_CODE, not by country name (CTY_NAME can only be requested as a descriptive field alongside CTY_CODE, not used as a filter by itself). Use this tool to translate a country name into the code you need.

Args:

  • query (string): country/region/bloc name or partial name, e.g. "korea", "vietnam", "european union"

  • limit (number, default 10): max matches to return

  • response_format ('markdown' | 'json', default 'markdown')

Returns: Matching entries with their CTY_CODE, name, and ISO alpha-2 code (for individual countries) or just code+name (for groupings). Note South Korea is listed as "South Korea (Republic of Korea)" and North Korea as "North Korea (Democratic People's Republic of Korea)".

Examples:

  • Use when: "What's the country code for Vietnam?" -> query="vietnam" -> returns CTY_CODE 5520

  • Use when: "I want export data for all EU countries as a group" -> query="european union" -> returns CTY_CODE 0003, then pass that as CTY_CODE in census_trade_query_exports filters

  • Don't use when: You already have the CTY_CODE - go straight to census_trade_query_exports/imports.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of matches to return.
queryYesCountry, region, or trade-bloc name (or partial name) to search for, e.g. 'korea', 'european union', 'canada'. Case-insensitive substring match.
response_formatNoOutput format: 'markdown' for a human-readable table, or 'json' for machine-readable structured data.markdown
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, and the description adds context beyond that: the API filters by numeric CTY_CODE rather than country name, CTY_NAME cannot be used as a filter, and return values include code, name, and ISO alpha-2 details. It also flags special naming for North/South Korea. This is valuable behavioral transparency, though it doesn't mention rate limits or match-failure behavior.

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

Conciseness4/5

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

The description is well-structured with intro, Args, Returns, and Examples sections, and it front-loads the core purpose and sibling relationship. It is somewhat longer than strictly necessary because the Args section repeats schema properties, but every other part contributes useful context such as API filtering behavior and usage examples.

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?

For a simple lookup tool with no output schema, the description is complete: it explains what the tool returns, the special case of country groupings, naming caveats, and how to chain the result into sibling tools. It covers when to use, when not to use, and gives concrete examples, so an agent can select and invoke it correctly without additional information.

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 schema already fully documents all three parameters with defaults, enums, and constraints. The description's Args section largely restates this information, though the examples ('korea', 'vietnam', 'european union') and the note about partial name matching add modest practical meaning beyond the schema.

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 clearly states the tool 'looks up' Census Bureau Schedule C CTY_CODE, including country groupings, and explicitly links this to filtering census_trade_query_exports/imports by country. This specific verb+resource framing and the mention of sibling tools distinguishes it from the query/list/dataset siblings.

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?

The description provides explicit use guidance: 'Use this tool to translate a country name into the code you need', plus concrete 'Use when' examples for Vietnam and European Union. It also gives an exclusion: 'Don't use when: You already have the CTY_CODE - go straight to census_trade_query_exports/imports', naming the alternative tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jslagle9/uscensus-intl-trade-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server