Skip to main content
Glama
india-gov-data-mcp

india-gov-data-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DATA_GOV_API_KEYYesYour personal data.gov.in API key, generated from the My Account page after registering at https://www.data.gov.in/.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

MCP server for India's Open Government Data portal (api.data.gov.in). Use search_catalog to discover datasets by keyword, inspect_schema to understand column names and types before querying, find_filter_values to resolve exact filter strings, query_records to fetch data with auto-pagination, aggregate_dataset for exact math, join_on_geography to merge two datasets on state/district, export_dataset to save CSV/JSON/Parquet locally, and get_citation for reproducible references.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": true
}
resources
{
  "subscribe": false,
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
search_catalogA

Search data.gov.in for datasets by keyword.

Returns up to limit matching datasets with their resource_id, title, ministry/sector, and description. Use this FIRST to discover the resource_id you need before calling other tools.

Examples of good queries:

  • "mandi prices agricultural commodities"

  • "air quality AQI pollution"

  • "census population state wise"

  • "electricity generation power"

  • "rural roads PMGSY"

inspect_schemaA

Inspect the schema of a data.gov.in resource before querying it.

Fetches 5 sample rows, infers each column's type (numeric, date, state, district, or text), and shows distinct sample values for categorical columns so you know the exact casing and spelling to use in filters.

Always call this before query_records or aggregate_dataset to avoid guessing column names or filter values.

query_recordsA

Fetch records from a data.gov.in resource with auto-pagination.

Automatically paginates past the 100-row API limit in batches, normalizes field names to snake_case, and canonicalizes Indian state/district names.

aggregate_datasetA

Compute an exact aggregation over a data.gov.in dataset using DuckDB.

Fetches filtered data, loads it into an in-memory DuckDB table, and runs a deterministic SUM, AVG, MIN, MAX, or COUNT grouped by the specified column. Use this instead of asking the LLM to do mental math — results are guaranteed correct.

join_on_geographyA

Join two data.gov.in datasets on normalized Indian geography.

Normalizes state or district names in both datasets (e.g. maps "Bangalore" → "Bengaluru", "Orissa" → "Odisha") so they match, then performs an inner join via DuckDB.

Use case: Combine AQI data with health data by state, or merge crop production with rainfall data by district.

get_citationA

Generate an official citation for a data.gov.in dataset.

Returns a citation block including the dataset title, resource_id, portal URL, any applied filters, and the UTC timestamp of retrieval. Use this to attribute data properly in reports and answers.

find_filter_valuesA

Discover exact, case-sensitive filter values for a dataset column.

api.data.gov.in requires exact filter strings (for example "Bengal Gram(Gram)(Whole)" instead of "Gram", or "Kozhikode(Calicut)" instead of "Kozhikode"). Use this tool before query_records or aggregate_dataset whenever a filter value might have parenthetical suffixes or non-obvious casing.

export_datasetA

Export records from a data.gov.in resource to CSV, JSON, or Parquet.

Normalizes column names to snake_case, canonicalizes Indian state/district names, creates parent directories if needed, and returns file metadata plus an official citation.

Prompts

Interactive templates invoked by user choice

NameDescription
compare_statesGuide the assistant to compare two Indian states on a public data topic.
mandi_price_checkGuide the assistant to inspect and aggregate daily APMC mandi prices.

Resources

Contextual data attached and managed by the client

NameDescription
geography_states_resourceCanonical 36 Indian States/UTs and known spelling/legacy variants.
featured_catalog_resourceCurated featured datasets from data.gov.in.

TDQS

A4/5.0

Scored across 8 tools

Disambiguation4/5

The eight tools map to clearly distinct stages of a data workflow: discovery (search_catalog), schema inspection (inspect_schema), retrieval (query_records), aggregation, joining, filtering, exporting, and citation. The only mild overlap is between inspect_schema and find_filter_values, both of which reveal exact filter values, but their descriptions draw a workable line between column/types and case-sensitive categorical values.

Naming Consistency5/5

Every tool follows a snake_case verb_noun pattern (inspect_schema, search_catalog, query_records, aggregate_dataset, find_filter_values, export_dataset, get_citation), all describing a concrete action on a concrete object. The one deviation, get_citation using 'get' rather than search/find, is trivial and still consistent with the pattern.

Tool Count5/5

Eight tools is well within the ideal 3-15 range and each one earns its place by covering a distinct step of the data access pipeline. There is no obvious filler or redundant tool.

Completeness4/5

The surface covers the full agent lifecycle from discovery through schema inspection, filtered retrieval, aggregation, geographic joins, export, and citation, with no real dead ends for ad-hoc analysis. Minor gaps exist: no direct metadata/resource-listing call, and no explicit control over pagination limits or catalog browsing by ministry/sector.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues