Skip to content

gemini-cli-extensions/datacommons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Commons Extension for Gemini CLI

This is a Gemini CLI extension that allows you to query public datasets from Data Commons using natural language, and to ground AI responses from any any other tools in authoritative data, to reduce hallucinations.

This page provides basic instructions for installing and running the extension. For complete information on using Data Commons with Gemini CLI, please see the Data Commons documentation.

Prerequisites

Before using this extension, you will need:

Installation

  1. Set your Data Commons API key as an environment variable in your shell or startup script (e.g. .bashrc):
    export DC_API_KEY=<YOUR_API_KEY>
    
  2. Install the extension directly from GitHub:
    gemini extensions install https://github.com/gemini-cli-extensions/datacommons

Note: If you have previously configured Gemini CLI to use the Data Commons MCP Server in a settings.json file (e.g. ~/.gemini/settings.json) and want to use the extension instead, be sure to delete the datacommons-mcp section from the file.

Usage

  1. Run gemini.
  2. To verify that the Data Commons tools are running, enter /mcp list. You should see the datacommons-mcp tools listed as "ready". If you don't, try running in debug mode to get diagnostic information.
  3. Ask questions about statistical data in natural language.

Examples

  • "What is the population of California?"
  • "Show me the median income in Santa Clara County."
  • "Compare the GDP of Japan and Germany."
  • "Poverty indicators for India"

How it works

This extension uses the datacommons-mcp PyPI package, which runs a local MCP server to translate natural language queries into Data Commons API calls. This package is based on the Data Commons MCP Server from the Data Commons Agent Toolkit.

The extension also provides a context file (DATACOMMONS.md) that gives the Gemini agent instructions on how to handle user queries and tool responses.

Troubleshooting

You can diagnose common errors, such as invalid API keys, by using the debug flag:

gemini -d

Uninstall

To uninstall the extension, run:

gemini extensions uninstall datacommons

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •