{
  "$schema": "https://modelcontextprotocol.io/schemas/2025-06-18/server-descriptor.json",
  "schema_version": "2025-06-18",
  "server": {
    "name": "gridrock",
    "title": "GridRock — Data Intelligence Layer of Bharat",
    "description": "First-party Indian geospatial + civic + environment + POI + transit intelligence. Self-onboard via RFC 7591; 60 req/min, 5,000 req/day on the free agent tier; agent-native response shapes via Accept: application/vnd.gridrock.agent+json.",
    "version": "1.0.0",
    "vendor": {
      "name": "GaliGaliSoftLabs",
      "url": "https://gridrock.ai/about",
      "contact": "hello@gridrock.ai"
    },
    "homepage": "https://gridrock.ai",
    "documentation": "https://gridrock.ai/docs",
    "license": "Commercial — see https://gridrock.ai/legal/tos",
    "terms": "https://gridrock.ai/legal/tos",
    "privacy": "https://gridrock.ai/legal/privacy"
  },
  "auth": {
    "type": "oauth2",
    "scheme": "client_credentials",
    "registration_endpoint": "https://api.gridrock.ai/oauth/register",
    "registration_endpoint_auth_methods": ["none"],
    "token_endpoint": "https://api.gridrock.ai/oauth/token",
    "token_endpoint_auth_methods": ["client_secret_post"],
    "metadata_endpoint": "https://api.gridrock.ai/.well-known/oauth-authorization-server",
    "scopes_supported": [
      "gridrock:free_agent",
      "gridrock:paid_agent"
    ],
    "default_scope": "gridrock:free_agent",
    "registration_required_fields": ["client_name", "tos_accepted", "intended_use", "contact_email"]
  },
  "transport": {
    "type": "http",
    "base_url": "https://api.gridrock.ai",
    "free_tier_base_url": "https://free.gridrock.ai",
    "default_accept": "application/vnd.gridrock.agent+json",
    "auth_header": "Authorization: Bearer {agtok_*}"
  },
  "rate_limits": {
    "free_agent": { "per_minute": 60, "per_day": 5000, "burst": 30 },
    "paid_agent": { "per_minute": 600, "per_day": 250000, "burst": 200 }
  },
  "discovery": {
    "openapi": "https://api.gridrock.ai/openapi.yaml",
    "llms_txt": "https://api.gridrock.ai/llms.txt",
    "ai_plugin": "https://api.gridrock.ai/.well-known/ai-plugin.json"
  },
  "tools": [
    {
      "name": "geo_lat_lng_to_h3",
      "description": "Convert a (lat, lng) to a stable H3 cell index at a given resolution. Pure math; use this to canonicalise spatial keys for joins.",
      "operationId": "geoLatLngToH3",
      "method": "GET",
      "path": "/v1/geo/h3",
      "input_schema": {
        "type": "object",
        "required": ["lat", "lng"],
        "properties": {
          "lat": { "type": "number", "minimum": -90, "maximum": 90 },
          "lng": { "type": "number", "minimum": -180, "maximum": 180 },
          "res": { "type": "integer", "minimum": 0, "maximum": 15, "default": 9 }
        }
      },
      "tokens_cost": 50,
      "typical_use_case": "Convert a GPS coordinate to a stable spatial key."
    },
    {
      "name": "geo_reverse",
      "description": "Reverse-geocode lat/lng to a city + ranked semantic labels (locality, ward, neighborhood, LULC, etc.).",
      "operationId": "geoReverse",
      "method": "GET",
      "path": "/v1/geo/reverse",
      "input_schema": {
        "type": "object",
        "required": ["lat", "lng"],
        "properties": {
          "lat": { "type": "number" },
          "lng": { "type": "number" },
          "res": { "type": "integer", "default": 9 }
        }
      },
      "tokens_cost": 600
    },
    {
      "name": "hex_labels",
      "description": "Get up to 32 semantic labels (locality, ward, LULC, NRSC overlays) for a single H3 cell.",
      "operationId": "hexLabels",
      "method": "GET",
      "path": "/v1/hex/{h3}/labels",
      "input_schema": {
        "type": "object",
        "required": ["h3"],
        "properties": { "h3": { "type": "string", "pattern": "^[0-9a-fA-F]{15,16}$" } }
      },
      "tokens_cost": 700
    },
    {
      "name": "hex_freshness",
      "description": "Get signal-by-signal freshness state for a single H3 cell (when each signal was last polled, when it expires).",
      "operationId": "hexFreshness",
      "method": "GET",
      "path": "/v1/hex/{h3}/freshness",
      "input_schema": {
        "type": "object",
        "required": ["h3"],
        "properties": { "h3": { "type": "string" } }
      },
      "tokens_cost": 300
    },
    {
      "name": "intel_hex",
      "description": "ONE-CALL FULL-STACK READOUT for a single H3 cell. Returns: cell math + boundary + 32 labels + 16 freshness rows + admin polygons + 5 nearest transit stops + top-10 POIs + 3 environment signals (AQI/weather/forecast). Use this when you want everything GridRock knows about a hex in one tool call.",
      "operationId": "intelHex",
      "method": "GET",
      "path": "/v1/intel/hex/{h3}",
      "input_schema": {
        "type": "object",
        "required": ["h3"],
        "properties": { "h3": { "type": "string" } }
      },
      "tokens_cost": 3500,
      "typical_use_case": "Full ground-truth context for a single 100m hex of India."
    },
    {
      "name": "env_aqi",
      "description": "Latest air-quality reading at lat/lng (resolves to res-8 hex internally; returns CPCB/SAFAR/OpenWeather observation depending on city coverage).",
      "operationId": "envAqi",
      "method": "GET",
      "path": "/v1/env/aqi",
      "input_schema": {
        "type": "object",
        "required": ["lat", "lng"],
        "properties": { "lat": { "type": "number" }, "lng": { "type": "number" } }
      },
      "tokens_cost": 300
    },
    {
      "name": "env_weather",
      "description": "Latest weather observation at lat/lng.",
      "operationId": "envWeather",
      "method": "GET",
      "path": "/v1/env/weather",
      "input_schema": { "type": "object", "required": ["lat", "lng"], "properties": { "lat": { "type": "number" }, "lng": { "type": "number" } } },
      "tokens_cost": 300
    },
    {
      "name": "env_forecast",
      "description": "24-hour weather forecast at lat/lng.",
      "operationId": "envForecast",
      "method": "GET",
      "path": "/v1/env/forecast",
      "input_schema": { "type": "object", "required": ["lat", "lng"], "properties": { "lat": { "type": "number" }, "lng": { "type": "number" }, "hours": { "type": "integer", "default": 24 } } },
      "tokens_cost": 300
    },
    {
      "name": "admin_ward",
      "description": "Get the enclosing municipal ward polygon for lat/lng. Layers: bmc_ward (Mumbai), pmc_ward (Pune), mcd_ward (Delhi), bbmp_ward (Bengaluru), kmc_ward (Kolkata), gcc_ward (Chennai), ghmc_ward (Hyderabad).",
      "operationId": "adminWard",
      "method": "GET",
      "path": "/v1/admin/ward",
      "input_schema": {
        "type": "object",
        "required": ["lat", "lng"],
        "properties": {
          "lat": { "type": "number" }, "lng": { "type": "number" },
          "layer": { "type": "string", "enum": ["bmc_ward","pmc_ward","mcd_ward","bbmp_ward","kmc_ward","gcc_ward","ghmc_ward"] }
        }
      },
      "tokens_cost": 250
    },
    {
      "name": "admin_pincode",
      "description": "Get the enclosing pincode polygon for lat/lng.",
      "operationId": "adminPincode",
      "method": "GET",
      "path": "/v1/admin/pincode",
      "input_schema": { "type": "object", "required": ["lat", "lng"], "properties": { "lat": { "type": "number" }, "lng": { "type": "number" } } },
      "tokens_cost": 200
    },
    {
      "name": "transit_nearest",
      "description": "Find the nearest transit stops within a radius (default 1km, max 5km).",
      "operationId": "transitNearest",
      "method": "GET",
      "path": "/v1/transit/nearest",
      "input_schema": {
        "type": "object",
        "required": ["lat", "lng"],
        "properties": {
          "lat": { "type": "number" }, "lng": { "type": "number" },
          "mode": { "type": "string", "enum": ["bus","metro","train","tram","ferry","mono"] },
          "radius_m": { "type": "integer", "default": 1000, "maximum": 5000 },
          "limit": { "type": "integer", "default": 10, "maximum": 25 }
        }
      },
      "tokens_cost": 600
    },
    {
      "name": "poi_nearby",
      "description": "Find points of interest within a radius. Free tier caps: radius_m≤1000, limit≤20, types≤60.",
      "operationId": "poiNearby",
      "method": "GET",
      "path": "/v1/poi/nearby",
      "input_schema": {
        "type": "object",
        "required": ["lat", "lng"],
        "properties": {
          "lat": { "type": "number" }, "lng": { "type": "number" },
          "radius_m": { "type": "integer", "default": 500, "maximum": 1000 },
          "type": { "type": "string", "description": "Comma-separated list of primary_types." },
          "limit": { "type": "integer", "default": 10, "maximum": 20 }
        }
      },
      "tokens_cost": 1500
    },
    {
      "name": "ref_holidays",
      "description": "India national holidays catalog (2025-2027).",
      "operationId": "refHolidays",
      "method": "GET",
      "path": "/v1/ref/holidays",
      "input_schema": { "type": "object", "properties": { "country": { "type": "string", "default": "IN" }, "year": { "type": "integer", "default": 2026 } } },
      "tokens_cost": 300
    },
    {
      "name": "meta_cities",
      "description": "List all onboarded cities and their bounding boxes.",
      "operationId": "metaCities",
      "method": "GET",
      "path": "/v1/meta/cities",
      "input_schema": { "type": "object", "properties": {} },
      "tokens_cost": 1500
    }
  ]
}
