Skip to main content
Glama

Search Census Variables

census_search_variables
Read-only

Search Census variables by keyword across variable labels and concept groups. Returns variable codes with human-readable labels — use this to go from a concept like "median household income" to the variable code B19013_001E needed for data queries. On ACS datasets it returns both estimate (E suffix) and margin-of-error (M suffix) codes so you can request both; other dataset families publish no margins of error. Also use it to find the predicate codes a dataset filters on, such as NAICS2017 in cbp. When total_matches exceeds the limit, narrow the query to see more specific results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoVintage year to search (default: latest available for the dataset).
limitNoMaximum results to return (default: 20, max: 100). Increase if total_matches greatly exceeds the limit.
queryYesKeyword to search (e.g., "median household income", "poverty", "bachelor's degree"). Multi-word queries search for all terms.
datasetNoDataset to search within (default: "acs/acs5"). Use census_list_datasets to discover options.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe limit that was applied.
yearNoVintage year that was searched.
errorNoPresent when the call failed. Absent on success.
shownNoNumber of variables returned after the limit.
noticeNoGuidance when no variables matched, or when results were truncated — suggests broader keywords, a narrower query, or a higher limit.
datasetNoDataset that was searched.
truncatedNoTrue when total_matches exceeded the limit and results were cut off.
variablesNoMatching variables sorted by relevance. On ACS datasets, codes ending in E are estimates and M are their margins of error; on other datasets the suffix carries no such meaning.
totalMatchesNoTotal variables matching the query before the limit was applied.
effectiveQueryNoQuery as the server parsed it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Even with readOnlyHint=true, the description adds substantial behavioral detail: ACS returns both E-suffix and M-suffix codes while other dataset families do not, it can locate predicate codes, and it explains how to respond when total_matches exceeds the limit. These are meaningful behaviors not visible from annotations alone.

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 well-organized, front-loads the core purpose, and each sentence contributes either a use case, a dataset nuance, or search guidance. There is no filler or repetition of schema details.

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?

Given the output schema exists and the tool is a straightforward search operation, the description covers everything an agent needs: what to search for, what results look like, dataset-specific behavior, special predicate-code usage, and how to handle overly broad results.

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 description coverage is 100%, so the baseline is 3. The description adds value by clarifying that queries search across labels and concept groups, providing realistic example queries, and explaining dataset-specific output behavior, which enriches the meaning of the query and dataset parameters 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 states a specific verb (search), resource (Census variables), and scope (keyword across variable labels and concept groups). It goes further by explaining the practical transformation from a concept like 'median household income' to a variable code, clearly differentiating it from sibling tools like census_get_variable or census_query_data.

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 gives clear, actionable context: use this to convert concepts to variable codes, to get both estimates and margins of error on ACS, and to find predicate codes like NAICS2017. It does not explicitly state when not to use it or name alternatives, but the examples strongly imply its niche among the sibling tools.

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.