bharatlas

v1.8.0
io.github.sathya-sankaran/bharatlas-mcp Checked 4 hours ago Published 7 days ago

Query India's open geo data, and author collect maps: register a link, moderate, publish.

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

list_layers

List available geo layers. Use to discover what data bharatlas has. Returns layer IDs, names, row counts, categories, realm (below, ground or air) and, for the layers the point lookups read, `lookups` ({ground: section, surface: section}: the section of ground_at or surface_at that reads the layer). Filter by category (boundaries, city-wards, environment, water, agriculture, transport, etc.), realm, admin level (state, district, block, village, etc.), source, or text search.

ParameterTypeDescription
categorystringFilter by category: boundaries, city-wards, people, environment, water, agriculture, transport, infrastructure, health-edu, economy
levelstringFilter by admin level: state, district, subdistrict, block, village, etc.
limitnumberMax results (default 20)
offsetnumberSkip N results for pagination
qstringText search across layer IDs, sources, and descriptions
realmstringFilter by realm: below (rocks, faults, minerals, aquifers, groundwater), ground (boundaries, wards, rivers, forests, roads, places), air (cyclone tracks)
sourcestringFilter by data source: LGD, SOI, Bhuvan, OpenCity, DataMeet, etc.

get_layer_schema

Get column names, types, and values for a layer (all of them for a column with at most 20; distinct_count; up to 50 values with row counts). Use BEFORE querying to discover what columns exist and what values they contain. Essential for knowing the right column names for filters.

ParameterTypeDescription
layer_id *stringLayer ID (e.g. lgd_states, airports, soi_forests, wards_chennai)

query_layer

Query a layer's data with filters and grouping. Reads the parquet file at runtime. Supports: select specific columns, filter by column values, group by a column to get counts, and sum numeric columns per group (e.g. roll block areas up to district totals). Use get_layer_schema first to discover column names. Examples: 'airports in Karnataka' -> where: {state: 'Karnataka'}, 'forest types' -> group_by: 'type', 'health facilities in Bihar' -> where: {state: 'BIHAR'}, select: ['name', 'type'].

ParameterTypeDescription
layer_id *stringLayer ID to query
group_bystringColumn to group by. Returns {value: count} instead of rows.
include_centroidbooleanInclude _lat/_lng centroid coordinates (defaults to true). Set false to exclude.
limitnumberMax rows (default 100, max 1000)
selectarrayColumn names to return. Omit for all non-geometry columns.
sumarrayNumeric columns to total per group (requires group_by). Adds {sums: {group: {col: total}}}. Use this to roll finer units up, e.g. block-level areas to district totals. Shares/percentages are not addit…
whereobjectFilter conditions as {column: value} pairs. Exact, case-insensitive match on flat columns (not partial). Values may contain commas.

locate

Given a latitude/longitude, find which administrative boundaries, zones, and regions contain that point. Returns state, district, subdistrict, block, parliament/assembly constituency, pincode, seismic zone, high court jurisdiction, the municipal ward (for the 30+ cities with ward layers), and more. The 'where am I?' tool. Also accepts specific layer IDs to check.

ParameterTypeDescription
lat *numberLatitude (6 to 38, India bounding box)
lng *numberLongitude (68 to 98, India bounding box)
layersarraySpecific layer IDs to check. Omit to use the default: 13 essential admin/zone layers PLUS the city ward layer(s) covering the point (for the 30+ cities with ward layers). Passing this replaces the def…

nearby

Find features from a layer that are near a given point, nearest first, within radius_km. Works for points, polygons and lines: points are measured to the point, lines and polygons to the nearest part of their shape (0 inside a polygon; `_distance_to` says which). Returns the true count within the radius plus the nearest `limit`. Example: 'reservoirs near Bengaluru' -> layer_id: 'wris_reservoirs', lat: 12.97, lng: 77.59, radius_km: 50.

ParameterTypeDescription
lat *numberCenter point latitude
layer_id *stringLayer to search for nearby features
lng *numberCenter point longitude
limitnumberMax results (default 20)
radius_kmnumberSearch radius in kilometres (default 25, max 200)

ground_at

What is below a point, in one call: seismic zone, nearest active faults, lineaments and recorded earthquakes, rock type (GSI lithology) and landform, aquifer, a permeability class (GLHYMPS, global and coarse), nearby groundwater wells, soil at 0-5, 5-15 and 15-30 cm (ISRIC SoilGrids 2.0: clay, sand, silt, pH, organic carbon, bulk density, CEC, nitrogen, WRB soil group) and the nearest Soil Health Card sample, ground subsidence (cm/yr) in megacities, and tunnels, buried pipelines and cables, mines and caves nearby. Returns a one-line `summary` plus `sections`, each layer with its credit, licenc…

ParameterTypeDescription
lat *numberLatitude (6 to 38, India bounding box)
lng *numberLongitude (68 to 98, India bounding box)
layersarrayRead only these layers (ids, e.g. soilgrids (the SoilGrids raster), seismic_zones, cgwb_aquifers), as well as any sections asked; default all
open_onlybooleantrue leaves out the non-commercial layers (for commercial use); default false
sectionsarrayRead only these sections (an array, or one comma-separated string); default all

surface_at

What is on the ground at a point, in one call: the admin units, ward and pincode; land cover, elevation and slope, population density and block land use; climate zones; the river basin, nearest river, water body, dam and wetland, and flood history; hazards (seismic zone, landslides, cyclone tracks, coastal regulation zone); forests and protected areas with the nearest one; the nearest highway, railway and metro station, airport and bus stop; the nearest hospital (three sources) and school, and places within 1 km; the nearest power line, power plant and water-supply facility; distance to India'…

ParameterTypeDescription
lat *numberLatitude (6 to 38, India bounding box)
lng *numberLongitude (68 to 98, India bounding box)
layersarrayRead only these layers (ids, e.g. dem, worldcover and worldpop (the rasters), ir_stations, gs_highways, or a ward layer such as wards_chennai), as well as any sections asked; default all
open_onlybooleantrue leaves out the non-commercial layers (for commercial use); default false
sectionsarrayRead only these sections (an array, or one comma-separated string); default all

list_categories

List all data categories with layer counts.

get_layer_detail

Get full metadata for a single layer: download URLs (parquet, pmtiles, geojson, kml, shapefile), attribution, license, feature count, level metadata, realm (below, ground or air), `lookups` (the section of ground_at or surface_at that reads it, if any), and versions (the dated releases to cite).

ParameterTypeDescription
layer_id *stringLayer ID

list_submissions

List community-submitted geo layers. These are user-contributed datasets under open licenses. Filter by category or search by name.

ParameterTypeDescription
categorystringFilter by category
limitnumberMax results (default 20)
offsetnumberPagination offset
qstringSearch name and description
sortstringSort order (default: recent)

register_map

Register a collect map so this server can act on it. Paste the whole share link (e.g. https://collect.bharatlas.com/c/<id>/admin#<token>). The token in the #fragment sets your scope: admin = full control, collect = add points, view = read published. New maps are created online at collect.bharatlas.com first (no account or key needed); this registers one you already made.

ParameterTypeDescription
link *stringa collect.bharatlas.com share link with the token in the #fragment

list_my_maps

List the collect maps you have registered here (local store), each with its scope.

get_map

A collect map's metadata + record counts, plus a link to open it in collect. Any registered scope.

ParameterTypeDescription
id *stringthe map (collection) id

get_records

A collect map's records as a GeoJSON FeatureCollection, for reading, analysis, or backup/export. view and collect scope return published points; admin can also read pending/rejected via status. Each record's properties._photos lists its photo links (public once the point is approved); _ai holds notes a model wrote from the photo (others see only notes the owner accepted).

ParameterTypeDescription
id *string
statusstringadmin only: pending | published | rejected

moderate_record

Approve or reject one pending point (needs the admin link). Pass the map id it belongs to.

ParameterTypeDescription
id *stringthe map (collection) id
record_id *string
status *
reasonstring

import_points

Bulk-import points you already hold into a collect map (needs the admin link). NOT for synthetic data. Requires a named source + rights confirmation; each row lands with that source as its provenance. Re-running is safe for rows with a client id (the row's own stable id, unique within the map, up to 128 characters): a row already imported with that id is updated in place if its data changed and otherwise left alone, so the same import twice adds nothing. The client id is the record's `client_id`, else the property named by client_id_field, else (by default) the GeoJSON feature `id`, then an `i…

ParameterTypeDescription
id *string
records *arrayGeoJSON-like {geometry, properties}, optionally with client_id
rights_confirmed *booleanyou have the right to publish this under the map's licence
source *string
client_id_fieldstringproperty holding each row's stable id (e.g. "code"); default: feature id, then an `id` property; "" for none

edit_map

Edit a collect map's settings: name/description/purpose/category/data_year/basemap (needs the admin link). Licence can only change while the map has no records.

ParameterTypeDescription
id *string
basemapstring
categorystring
data_yearinteger | null
descriptionstring
licensestring
namestring
purposestring

publish

Submit a collect map's approved points to the bharatlas catalog for review (needs the admin link). Nothing goes live automatically: a maintainer approves the submission first; the response status is 'pending' until then. Once approved it is queryable via list_submissions / query_layer / locate above.

ParameterTypeDescription
id *string

create_map

Optional: create a collect map programmatically. Most maps are made online at collect.bharatlas.com (no key needed); prefer that and register_map the link. This path needs COLLECT_API_KEY (the request-only anti-abuse gate) and auto-registers the new admin link.

ParameterTypeDescription
fields *arraythe form for each record (see collect.bharatlas.com/schema/v1.json); a field of type "photo" (max_photos 1-3) asks for photos
geometry *arraywhat contributors may add
name *string3-120 chars
purpose *stringshown to contributors
basemap
categorystring
data_yearinteger
descriptionstring
licensestringopen licence id (CC0-1.0, CC-BY-4.0, CC-BY-SA-4.0, ODbL-1.0, ODC-PDDL-1.0, GODL-India, CDLA-Permissive-2.0); default CC0-1.0, and the answer names the licence used
modehow people collect: form (default); form_ai = form plus notes a model writes from the photo, for the owner to check; photos_ai = people only take photos and the model fills the form (places only). AI…
moderationbooleandefault true: points wait for approval