/** * @fileoverview Barrel export for all census-mcp-server tool definitions. * @module mcp-server/tools/definitions/index */ import { censusCompareGeographies } from './census-compare-geographies.tool.js'; import { censusGetVariable } from './census-get-variable.tool.js'; import { censusListDatasets } from './census-list-datasets.tool.js'; import { censusListGeographies } from './census-list-geographies.tool.js'; import { censusListPredicateValues } from './census-list-predicate-values.tool.js'; import { censusQueryData } from './census-query-data.tool.js'; import { censusResolveGeography } from './census-resolve-geography.tool.js'; import { censusSearchVariables } from './census-search-variables.tool.js'; export { censusCompareGeographies, censusGetVariable, censusListDatasets, censusListGeographies, censusListPredicateValues, censusQueryData, censusResolveGeography, censusSearchVariables, }; export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ datasets: import("zod").ZodArray; }, import("zod/v4/core").$strip>>; }, import("zod/v4/core").$strip>, undefined, { readonly totalCount: import("zod").ZodNumber; readonly filterApplied: import("zod").ZodOptional; readonly notice: import("zod").ZodOptional; }> | import("@cyanheads/mcp-ts-core").ToolDefinition; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ geography_levels: import("zod").ZodArray; example: import("zod").ZodString; }, import("zod/v4/core").$strip>>; }, import("zod/v4/core").$strip>, readonly [{ readonly reason: "dataset_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "Dataset code is missing or not recognized, even after case and shorthand resolution."; readonly thrownBy: "service"; readonly recovery: "Call census_list_datasets to discover valid dataset codes like acs/acs5."; }, { readonly reason: "year_not_available"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "Dataset exists but the requested year has no data."; readonly recovery: "Check available_years in census_list_datasets for valid years for this dataset."; }], { readonly dataset: import("zod").ZodString; readonly year: import("zod").ZodNumber; readonly totalLevels: import("zod").ZodNumber; }> | import("@cyanheads/mcp-ts-core").ToolDefinition; year: import("zod").ZodOptional; limit: import("zod").ZodOptional; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ variables: import("zod").ZodArray; predicate_type: import("zod").ZodString; estimate_code: import("zod").ZodOptional; moe_code: import("zod").ZodOptional; }, import("zod/v4/core").$strip>>; }, import("zod/v4/core").$strip>, readonly [{ readonly reason: "dataset_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "Dataset code is not recognized, even after case and shorthand resolution."; readonly thrownBy: "service"; readonly recovery: "Call census_list_datasets to discover valid dataset codes like acs/acs5."; }, { readonly reason: "year_not_available"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The dataset does not serve the requested vintage year."; readonly thrownBy: "service"; readonly recovery: "Retry with a year from available_years in census_list_datasets; the error names the years this dataset serves."; }, { readonly reason: "variables_unavailable"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable; readonly when: "Variable metadata could not be fetched or parsed from the Census API."; readonly retryable: true; readonly thrownBy: "service"; readonly recovery: "Retry the request; if persistent, the dataset and year combination may not be available."; }], { readonly effectiveQuery: import("zod").ZodString; readonly dataset: import("zod").ZodString; readonly year: import("zod").ZodNumber; readonly totalMatches: import("zod").ZodNumber; readonly truncated: import("zod").ZodOptional; readonly shown: import("zod").ZodOptional; readonly cap: import("zod").ZodOptional; readonly notice: import("zod").ZodOptional; }> | import("@cyanheads/mcp-ts-core").ToolDefinition; dataset: import("zod").ZodOptional; year: import("zod").ZodOptional; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ variables: import("zod").ZodArray; predicate_type: import("zod").ZodString; universe: import("zod").ZodOptional; attribute_of: import("zod").ZodOptional; attribute_type: import("zod").ZodOptional; estimate_code: import("zod").ZodOptional; moe_code: import("zod").ZodOptional; }, import("zod/v4/core").$strip>>; dataset: import("zod").ZodString; year: import("zod").ZodNumber; }, import("zod/v4/core").$strip>, readonly [{ readonly reason: "variable_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "One or more variable codes were not found in the dataset and year."; readonly thrownBy: "service"; readonly recovery: "Use census_search_variables to discover valid variable codes for this dataset and year."; }, { readonly reason: "dataset_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "Dataset code is not recognized, even after case and shorthand resolution."; readonly thrownBy: "service"; readonly recovery: "Call census_list_datasets to discover valid dataset codes like acs/acs5."; }, { readonly reason: "year_not_available"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The dataset does not serve the requested vintage year."; readonly thrownBy: "service"; readonly recovery: "Retry with a year from available_years in census_list_datasets; the error names the years this dataset serves."; }, { readonly reason: "variables_unavailable"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable; readonly when: "Variable metadata — the dataset's variables.json, groups.json, or an attribute column's own entry — could not be fetched or parsed."; readonly retryable: true; readonly thrownBy: "service"; readonly recovery: "Retry the request; if persistent, the dataset and year combination may not be available."; }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition; query: import("zod").ZodOptional; within_naics: import("zod").ZodOptional, import("zod").ZodString]>>; limit: import("zod").ZodOptional; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ values: import("zod").ZodArray>; predicate: import("zod").ZodString; predicate_label: import("zod").ZodString; dataset: import("zod").ZodString; year: import("zod").ZodNumber; }, import("zod/v4/core").$strip>, readonly [{ readonly reason: "dataset_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "Dataset code is missing or not recognized, even after case and shorthand resolution."; readonly thrownBy: "service"; readonly recovery: "Call census_list_datasets to discover valid dataset codes like cbp or nonemp."; }, { readonly reason: "year_not_available"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The dataset does not serve the requested vintage year."; readonly thrownBy: "service"; readonly recovery: "Retry with a year from available_years in census_list_datasets; the error names the years this dataset serves."; }, { readonly reason: "predicate_not_supported"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "The predicate code is not a variable in this dataset and year."; readonly recovery: "Call census_search_variables on this dataset and year for the codes it does define — dimension names are vintage-specific, so NAICS2017 and NAICS2022 belong to different years."; }, { readonly reason: "not_a_filter_dimension"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The code is not one of the dimensions the dataset filters on, so it takes no value list."; readonly recovery: "Pass a dimension the dataset filters on. The response notice of census_query_data names every dimension a dataset declares, and census_get_variable confirms what a code is."; }, { readonly reason: "no_values"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "The dimension returned no codes for the scope requested."; readonly recovery: "Drop within_naics, or try a broader industry code — a narrow leaf industry often publishes only the all-establishments row."; }, { readonly reason: "upstream_error"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable; readonly when: "Census API returned an error or was unreachable."; readonly retryable: true; readonly thrownBy: "service"; readonly recovery: "Retry the request; if the error persists, the Census API may be temporarily unavailable."; }], { readonly totalCount: import("zod").ZodNumber; readonly truncated: import("zod").ZodBoolean; readonly source: import("zod").ZodString; readonly notice: import("zod").ZodOptional; }> | import("@cyanheads/mcp-ts-core").ToolDefinition>; county_fips: import("zod").ZodOptional; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ name: import("zod").ZodString; geography_type: import("zod").ZodString; state_fips: import("zod").ZodOptional; county_fips: import("zod").ZodOptional; tract_fips: import("zod").ZodOptional; block_group_fips: import("zod").ZodOptional; place_fips: import("zod").ZodOptional; census_designated_place: import("zod").ZodOptional>; fips_summary: import("zod").ZodString; }, import("zod/v4/core").$strip>, readonly [{ readonly reason: "no_match"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "Place name not recognized at any geography level tried for it."; readonly thrownBy: "service"; readonly recovery: "Check the spelling, set geography_type to search a different level, or pass a full street address."; }, { readonly reason: "ambiguous_name"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "Name matched more than one geography."; readonly thrownBy: "service"; readonly recovery: "Take fips_summary from the candidate you want in the error, or re-call with the candidate name — tract candidates need county_fips instead, since they share a name."; }, { readonly reason: "county_scope_unsupported"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "county_fips was combined with a street address, or with a geography_type — set or auto-detected — that does not sit within a county."; readonly thrownBy: "service"; readonly recovery: "Drop county_fips, or set geography_type to \"county\" or \"tract\" to use it."; }, { readonly reason: "resolution_unavailable"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable; readonly when: "Geography resolution endpoint was unreachable."; readonly retryable: true; readonly thrownBy: "service"; readonly recovery: "Retry the request — the Census geography endpoints are free-tier with no auth requirements."; }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition; geography_level: import("zod").ZodString; geography_fips: import("zod").ZodString; parent_fips: import("zod").ZodOptional, import("zod").ZodString]>>; county_fips: import("zod").ZodOptional, import("zod").ZodString]>>; tract_fips: import("zod").ZodOptional, import("zod").ZodString]>>; predicates: import("zod").ZodOptional>; dataset: import("zod").ZodOptional; year: import("zod").ZodOptional; limit: import("zod").ZodOptional; offset: import("zod").ZodOptional; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ rows: import("zod").ZodArray; applied_filters: import("zod").ZodOptional>; record: import("zod").ZodOptional>; }, import("zod/v4/core").$strip>>; }, import("zod/v4/core").$strip>, readonly [{ readonly reason: "dataset_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "Dataset code is not recognized, even after case and shorthand resolution."; readonly thrownBy: "service"; readonly recovery: "Call census_list_datasets to discover valid dataset codes like acs/acs5."; }, { readonly reason: "missing_api_key"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Unauthorized; readonly when: "CENSUS_API_KEY is not configured or the key is invalid."; readonly thrownBy: "service"; readonly recovery: "Set the CENSUS_API_KEY environment variable and restart the server. Register a free key at api.census.gov/data/key_signup.html."; }, { readonly reason: "year_not_available"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The dataset does not serve the requested vintage year."; readonly thrownBy: "service"; readonly recovery: "Retry with a year from available_years in census_list_datasets; the error names the years this dataset serves."; }, { readonly reason: "variable_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "The Census API rejected a variable code as unknown for the requested dataset and year. It names only the first unknown code in a request."; readonly thrownBy: "service"; readonly recovery: "Call census_search_variables or census_get_variable to confirm codes for this dataset and year."; }, { readonly reason: "variables_unavailable"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable; readonly when: "The variable metadata endpoint returned an unparseable response for this dataset and year."; readonly retryable: true; readonly thrownBy: "service"; readonly recovery: "Retry the request; if it persists, the Census metadata endpoint is temporarily unavailable."; }, { readonly reason: "geography_not_supported"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The requested geography level does not exist in this dataset and year."; readonly recovery: "Call census_list_geographies to see supported geography levels for this dataset."; }, { readonly reason: "parent_required"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The geography level requires a parent FIPS code but parent_fips was not provided, a tract/block-group level requires county_fips but it was omitted, a single block group requires tract_fips, or tract_fips was set without a concrete county_fips."; readonly recovery: "Add parent_fips (state FIPS) from census_resolve_geography state_fips. For tract or block-group levels also add county_fips from census_resolve_geography county_fips, and for a single block group add tract_fips."; }, { readonly reason: "parent_not_accepted"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "parent_fips, county_fips, or tract_fips names a parent the geography level does not sit within."; readonly recovery: "Drop the parent this level does not name. Levels such as zip code tabulation area, urban area, and metropolitan statistical area/micropolitan statistical area are queried with no parent at all; census_list_geographies shows the parents each level takes."; }, { readonly reason: "no_data"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "The query returned no rows."; readonly recovery: "Confirm the FIPS codes exist for this dataset and year — census_resolve_geography returns them for a place name, and census_list_geographies confirms the level is supported."; }, { readonly reason: "too_many_variables"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The variable codes plus NAME and the label and record columns added for the dataset exceed the 50 columns the Census API accepts per request."; readonly recovery: "Split the codes across several calls of at most the maximum the error states — 49 on ACS, fewer where label or record columns are added."; }, { readonly reason: "predicate_not_supported"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "A key in predicates is not a variable in this dataset and year."; readonly recovery: "Remove the unrecognized key. Call census_search_variables on this dataset and year for the codes it does define — predicate names are vintage-specific, so NAICS2017 and NAICS2022 belong to different years."; }, { readonly reason: "upstream_error"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable; readonly when: "Census API returned an error or was unreachable."; readonly retryable: true; readonly thrownBy: "service"; readonly recovery: "Retry the request; if the error persists, the Census API may be temporarily unavailable."; }], { readonly totalRows: import("zod").ZodNumber; readonly totalCount: import("zod").ZodNumber; readonly truncated: import("zod").ZodBoolean; readonly dataset: import("zod").ZodString; readonly year: import("zod").ZodNumber; readonly notice: import("zod").ZodOptional; }> | import("@cyanheads/mcp-ts-core").ToolDefinition; geography_level: import("zod").ZodString; within: import("zod").ZodOptional, import("zod").ZodString]>>; within_county: import("zod").ZodOptional, import("zod").ZodString]>>; geographies: import("zod").ZodOptional>; predicates: import("zod").ZodOptional>; dataset: import("zod").ZodOptional; year: import("zod").ZodOptional; sort_by: import("zod").ZodOptional; sort_dir: import("zod").ZodOptional>; limit: import("zod").ZodOptional; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ rows: import("zod").ZodArray; applied_filters: import("zod").ZodOptional>; record: import("zod").ZodOptional>; rank: import("zod").ZodNumber; }, import("zod/v4/core").$strip>>; }, import("zod/v4/core").$strip>, readonly [{ readonly reason: "dataset_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "Dataset code is not recognized, even after case and shorthand resolution."; readonly thrownBy: "service"; readonly recovery: "Call census_list_datasets to discover valid dataset codes like acs/acs5."; }, { readonly reason: "missing_api_key"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Unauthorized; readonly when: "CENSUS_API_KEY is not configured or the key is invalid."; readonly thrownBy: "service"; readonly recovery: "Set the CENSUS_API_KEY environment variable and restart the server. Register a free key at api.census.gov/data/key_signup.html."; }, { readonly reason: "geography_not_supported"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The requested geography level does not exist in this dataset and year."; readonly recovery: "Call census_list_geographies to see supported geography levels for this dataset and year."; }, { readonly reason: "parent_required"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The geography level requires a parent FIPS but within, or within_county, was not provided."; readonly recovery: "Add the within parameter with the state FIPS from census_resolve_geography state_fips. For tract or block-group levels also add within_county from census_resolve_geography county_fips."; }, { readonly reason: "parent_not_accepted"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "within or within_county names a parent the geography level does not sit within."; readonly recovery: "Drop the parent this level does not name. Levels such as urban area, zip code tabulation area, and metropolitan statistical area/micropolitan statistical area are compared nationally with no scope at all; census_list_geographies shows the parents each level takes."; }, { readonly reason: "year_not_available"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The dataset does not serve the requested vintage year."; readonly thrownBy: "service"; readonly recovery: "Retry with a year from available_years in census_list_datasets; the error names the years this dataset serves."; }, { readonly reason: "variable_not_found"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "The Census API rejected a variable code as unknown for this dataset and year. It names only the first unknown code in a request."; readonly thrownBy: "service"; readonly recovery: "Use census_search_variables or census_get_variable to confirm codes for this dataset and year."; }, { readonly reason: "too_many_variables"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The variable codes plus NAME and the label and record columns added for the dataset exceed the 50 columns the Census API accepts per request."; readonly recovery: "Split the codes across several comparisons of at most the maximum the error states — 49 on ACS, fewer where label or record columns are added."; }, { readonly reason: "variables_unavailable"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable; readonly when: "The variable metadata endpoint returned an unparseable response for this dataset and year."; readonly retryable: true; readonly thrownBy: "service"; readonly recovery: "Retry the request; if it persists, the Census metadata endpoint is temporarily unavailable."; }, { readonly reason: "predicate_not_supported"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "A key in predicates is not a variable in this dataset and year."; readonly recovery: "Remove the unrecognized key. Call census_search_variables on this dataset and year for the codes it does define — predicate names are vintage-specific, so NAICS2017 and NAICS2022 belong to different years."; }, { readonly reason: "sort_by_not_requested"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "sort_by names a code that is not among the requested variables, so no column exists to rank on."; readonly recovery: "Set sort_by to one of the codes in variables, or add that code to variables and rank on it."; }, { readonly reason: "ambiguous_rows"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError; readonly when: "The dataset publishes several records per geography and the comparison pinned none of them, so every geography would occupy several ranks with different values."; readonly recovery: "Add the record column named in the error to predicates to pin one record — on pep/charv that is MONTH, where \"7\" selects the July estimate and \"4\" the April estimates base. census_query_data returns every record for a single geography if you need to see them first."; }, { readonly reason: "no_data"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound; readonly when: "No geographies were returned for the query, or no row matched any entry in the geographies list."; readonly recovery: "Confirm the level is populated for this dataset and year with census_list_geographies, and that any geographies entries are valid FIPS codes from census_resolve_geography."; }, { readonly reason: "upstream_error"; readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable; readonly when: "Census API was unreachable or returned an error."; readonly retryable: true; readonly thrownBy: "service"; readonly recovery: "Retry the request; if the error persists, the Census API may be temporarily unavailable."; }], { readonly totalCount: import("zod").ZodNumber; readonly truncated: import("zod").ZodBoolean; readonly sortVariable: import("zod").ZodString; readonly dataset: import("zod").ZodString; readonly year: import("zod").ZodNumber; readonly notice: import("zod").ZodOptional; }>)[]; //# sourceMappingURL=index.d.ts.map