Geography
Encode lat/lng into Uber H3 hexagons (res 0-15) and Google S2 Hilbert cells (level 1-30) with index, id, token, quadkey, areas, k-ring neighbors, compaction, parent ladders and round-trip drift.
Call this tool from your code in three languages.
curl -X POST 'http://127.0.0.1:3003/en/api/tools/h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge' \
-H 'Content-Type: application/json' \
-d '{"latitude":37.7796,"longitude":-122.4194,"h3Resolution":9,"s2Level":14,"kRing":1,"showCompact":true}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST http://127.0.0.1:3003/en/api/tools/h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge| Name | Type | Required | Description |
|---|---|---|---|
| latitude | number | Yes | — |
| longitude | number | Yes | — |
| h3Resolution | number | No | — |
| s2Level | number | No | — |
| kRing | number | No | — |
| showCompact |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge": {
"name": "h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge",
"description": "Encode lat/lng into Uber H3 hexagons (res 0-15) and Google S2 Hilbert cells (level 1-30) with index, id, token, quadkey, areas, k-ring neighbors, compaction, parent ladders and round-trip drift.",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge",
"arguments": {
"latitude": 37.7796,
"longitude": -122.4194,
"h3Resolution": 9,
"s2Level": 14,
"kRing": 1,
"showCompact": true
}
}
}| checkbox |
| No |
| — |
HTML result
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Questions or issues? Contact [email protected]