Datacommons

v0.2.1
io.github.pipeworx-io/datacommons Checked 1 day ago Published 1 month ago

Data Commons MCP — harmonised public statistics for places, from Google Data Commons (REST v2).

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

datacommons_find_place

Find the Google Data Commons place id (dcid) for a place name — country, state, county, city, region. Returns candidates with name and place type, e.g. "California" -> geoId/06, "India" -> country/IND. Use the dcid with datacommons_observation or datacommons_child_places. Narrow ambiguous names (Paris, Georgia) with place_type.

ParameterTypeDescription
_apiKey *stringData Commons API key (free). Get one at https://apikeys.datacommons.org
name *stringPlace name, e.g. "California", "Paris", "Cook County"
limitnumberMax candidates (default 10, max 25)
place_typestringRestrict to one place type, e.g. Country, State, County, City, AdministrativeArea1, EurostatNUTS2

datacommons_find_variable

Search Google Data Commons statistical variables by plain-language indicator, e.g. "median household income" -> Median_Income_Household, "unemployment rate" -> UnemploymentRate_Person. Returns variable ids with names and a match score. Use the id as `variable` in datacommons_observation.

ParameterTypeDescription
_apiKey *stringData Commons API key (free). Get one at https://apikeys.datacommons.org
query *stringWhat you want to measure, e.g. "life expectancy", "CO2 emissions per capita"
limitnumberMax variables (default 10, max 25)

datacommons_observation

Get the value of one Google Data Commons statistical variable for one place: the latest value (default), the value at a date, or the whole time series. Each value names its original publisher (US Census, World Bank, Eurostat, CDC, ...) and lists how alternate sources differ. Example: variable "Count_Person", place "country/USA".

ParameterTypeDescription
_apiKey *stringData Commons API key (free). Get one at https://apikeys.datacommons.org
place *stringPlace dcid, e.g. country/USA, geoId/06, Earth (find with datacommons_find_place)
variable *stringStatistical variable dcid, e.g. Count_Person, Median_Income_Household (find with datacommons_find_variable)
datestringLATEST (default), all (full series), or a date: 2019, 2019-06, 2019-06-30
limitnumberWith date=all, max observations returned, most recent kept (default 50, max 500)

datacommons_child_places

Compare one Google Data Commons statistical variable across every child place of a parent — e.g. population of all US states, median income of every county in Texas (geoId/48, County), GDP of every country in Europe. Returns rows sorted by value with names and the publisher of each value.

ParameterTypeDescription
_apiKey *stringData Commons API key (free). Get one at https://apikeys.datacommons.org
child_type *stringChild place type, e.g. State, County, City, Country
parent_place *stringParent place dcid, e.g. country/USA, geoId/48, europe, Earth
variable *stringStatistical variable dcid, e.g. Count_Person
datestringLATEST (default) or a date: 2020, 2020-06
limitnumberMax rows (default 50, max 300)
sortstringSort by value (default desc)