Skip to main content
Glama

Get Census Variable Metadata

census_get_variable
Read-only

Fetch full metadata for one or more Census variable codes — label, concept group, predicate type, universe, and margin-of-error sibling references. Use to confirm a variable code before building a query, or to look up what a known code means. On ACS datasets it returns estimate_code and moe_code sibling references so you can request both without a separate search; other dataset families publish no margins of error and carry neither field. It also resolves predicate codes such as NAICS2017 or SEX, confirming a filter dimension exists in a dataset before a query uses it — for the values a dimension accepts rather than the dimension itself, call census_list_predicate_values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoVintage year (default: latest available for the dataset).
datasetNoDataset the variables belong to (default: "acs/acs5"). Use census_list_datasets to discover valid values.
variablesYesOne or more variable codes to look up (e.g., ["B19013_001E", "B19013_001M"]). Variable codes are case-sensitive.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoVintage year queried.
errorNoPresent when the call failed. Absent on success.
datasetNoDataset queried.
variablesNoVariable metadata in the same order as the input array.

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?

With readOnlyHint=true already signaling safety, the description adds valuable behavioral detail: ACS datasets return estimate_code and moe_code siblings while other dataset families do not, and predicate codes are resolved to confirm filter dimensions. No contradiction with annotations.

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 slightly longer than minimal but each sentence carries distinct value: primary purpose, use cases, dataset-family differences, and routing to a sibling tool. The key purpose is front-loaded in the first sentence.

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 read-only metadata lookup tool with an output schema and full schema coverage, the description covers purpose, use cases, alternatives, and cross-dataset behavioral differences. Nothing essential is missing for an agent to select and invoke it correctly.

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 the baseline is 3 and the schema already documents all parameters. The description adds useful examples and output behavior, but does not materially deepen parameter semantics beyond what the schema provides.

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 opens with a specific verb and resource: 'Fetch full metadata for one or more Census variable codes,' and enumerates the returned fields. It also contrasts with census_list_predicate_values, making it easy to distinguish from 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?

It explicitly says when to use the tool: 'Use to confirm a variable code before building a query, or to look up what a known code means.' It also names an alternative for a related case: predicate values should go to census_list_predicate_values.

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.