Skip to content
Cube coverageMH-362,64,583 clusters × 492Pan-India653 districts × 39reference →

Quickstart — cURL

Bharat Strata is served as a Model Context Protocol tool grammar over Streamable-HTTP at https://api.gridrock.ai/mcp. Every answer is a witness envelope — a claim carrying its generation, coverage honesty and uncertainty. Below is the raw JSON-RPC flow; any MCP-native client performs the handshake for you.

1. Open a session

Initialize and keep the Mcp-Session-Id response header for subsequent calls.

curl -sD - https://api.gridrock.ai/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize",
       "params":{"protocolVersion":"2025-06-18","capabilities":{},
                 "clientInfo":{"name":"curl","version":"0"}}}'

2. Resolve a point to its locality cell

curl -s https://api.gridrock.ai/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Mcp-Session-Id: $SID" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call",
       "params":{"name":"resolve_locality",
                 "arguments":{"lat":19.0760,"lng":72.8777}}}'

The witness envelope names the cube generation it answered from:

{
  "ok": true,
  "tool": "resolve_locality",
  "generation": { "namespace": "bs:cube:0852c73eef54",
                  "schema_fingerprint_ns": "0852c73eef54" },
  "result": { "admin_code": 483, "cluster_id": 4830000073,
              "anchor_key": "483:4830000073" },
  "coverage": { "method": "coarse_h3_nearest_cell", "scope": "mh36" },
  "error": null
}

3. Read the cell's witnessed cube row

Pass the resolved admin_code and cluster_id to read the full row, with three-way coverage honesty (observed / absent / present-but-uncertain).

curl -s https://api.gridrock.ai/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Mcp-Session-Id: $SID" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call",
       "params":{"name":"read_witnesses",
                 "arguments":{"admin_code":483,"cluster_id":4830000073}}}'

The engine returns evidence, never a verdict — it will refuse to invent a site score or a risk prior.

Next