Skip to main content
Glama

List Census Geography Levels

census_list_geographies
Read-only

List the geography levels available for a given Census dataset and year, along with the parent geographies each level requires. Use before querying to confirm that the target geography level exists — ACS1 omits many sub-state levels, and not all datasets support tracts or block groups. The geography_level values returned here are the valid inputs to the geography_level parameter in census_query_data and census_compare_geographies.

Input Schema

NameRequiredDescriptionDefault
yearNoVintage year. Defaults to the latest available year for the dataset.
datasetYesDataset code (e.g., "acs/acs5", "acs/acs1"). Use census_list_datasets to discover valid values. Case is ignored, and a two-part code can be given by its last part alone — "acs5" is acs/acs5, "pl" is dec/pl. Three-part codes such as acs/acs5/profile must be given in full. The response echoes the resolved code.

Output Schema

NameRequiredDescriptionDefault
yearNoVintage year queried.
errorNoPresent when the call failed. Absent on success.
datasetNoDataset queried.
totalLevelsNoDistinct geography levels available for this dataset and year — the count census_query_data and census_compare_geographies give for an unsupported level. Can be lower than the number of geography_levels entries, which repeat a level per parent hierarchy.
geography_levelsNoGeography levels supported by this dataset and year, one entry per parent hierarchy: a level published under several hierarchies (county under state, and under a metro area) appears once for each.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `dataset_not_found`: Dataset code is missing or not recognized, even after case and shorthand resolution. `year_not_available`: Dataset exists but the requested year has no data. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `dataset_not_found`: Dataset code is missing or not recognized, even after case and shorthand resolution. `year_not_available`: Dataset exists but the Census API publishes no geography list for the requested year. For a year outside the dataset's available_years, the error names the years it serves. `upstream_error`: The Census API answered the dataset's geography.json with an HTTP error other than a 404, or with HTML or an unparseable body. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "dataset_not_found",
      -  "year_not_available"
      -]New value: +[
      +  "dataset_not_found",
      +  "year_not_available",
      +  "upstream_error"
      +]
    • changedOutput schema / properties / geography_levels / description
      Previous value: -"Geography levels supported by this dataset and year."New value: +"Geography levels supported by this dataset and year, one entry per parent hierarchy: a level published under several hierarchies (county under state, and under a metro area) appears once for each."
    • changedOutput schema / properties / totalLevels / description
      Previous value: -"Total number of geography levels available for this dataset and year."New value: +"Distinct geography levels available for this dataset and year — the count census_query_data and census_compare_geographies give for an unsupported level. Can be lower than the number of geography_levels entries, which repeat a level per parent hierarchy."
  2. Changed2 schema fields changed
    • changedInput schema / properties / dataset / description
      Previous value: -"Dataset code (e.g., \"acs/acs5\", \"acs/acs1\"). Use census_list_datasets to discover valid values."New value: +"Dataset code (e.g., \"acs/acs5\", \"acs/acs1\"). Use census_list_datasets to discover valid values. Case is ignored, and a two-part code can be given by its last part alone — \"acs5\" is acs/acs5, \"pl\" is dec/pl. Three-part codes such as acs/acs5/profile must be given in full. The response echoes the resolved code."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `dataset_not_found`: Dataset code is not recognized. `year_not_available`: Dataset exists but the requested year has no data. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `dataset_not_found`: Dataset code is missing or not recognized, even after case and shorthand resolution. `year_not_available`: Dataset exists but the requested year has no data. Other values are possible when a failure originates below the handler."
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: the response includes required parent geographies, and the returned geography_level values are the valid inputs elsewhere. It omits any note on pagination, caching, or error behavior for unknown datasets, so it stops short of a 5.

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?

Three sentences, front-loaded with what is returned, then the when-to-use condition, then the downstream contract. No filler and every clause carries information.

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?

The tool is a simple two-parameter read with full schema coverage and an output schema, so return-value shape need not be described. The description covers purpose, preconditions, caveats, and the linkage to consuming tools, leaving nothing an agent needs to call 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 description coverage is 100% and the schema already explains the dataset code formats, case-insensitivity, two-part shorthand, and the year default. The description only restates "a given Census dataset and year" without adding format or constraint detail, so the baseline 3 applies.

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?

States a specific verb (list) and resource (geography levels) scoped by dataset and year, and adds the distinguishing detail that it also returns the parent geographies each level requires. An agent can separate this from census_list_datasets and census_list_predicate_values without opening a schema.

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?

"Use before querying to confirm that the target geography level exists" gives an explicit trigger, and it names concrete failure cases (ACS1 omits sub-state levels, some datasets lack tracts/block groups). It also routes the agent downstream by naming census_query_data and census_compare_geographies as consumers of the returned 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.