Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ARCGIS_URLNoPortal base URL, for ArcGIS Enterprise deploymentshttps://www.arcgis.com
HK_MCP_DIRNoWorkspace for the catalogue cache, downloaded GeoJSON and the generated map./hk-spatial
HK_MCP_BINDNoBind address for the map preview server; set 0.0.0.0 only behind a reverse proxy127.0.0.1
HK_MCP_HOSTNoBind address for the HTTP transport127.0.0.1
HK_MCP_PORTNoPort for the map preview server8777
ARCGIS_TOKENNoArcGIS Online user/OAuth token; required only for the content and publishing tools
HK_MCP_HTTP_PORTNoPort for the HTTP transport (endpoint /mcp)8788
HK_MCP_TRANSPORTNoTransport mode: stdio, streamable-http or ssestdio
HK_MCP_PUBLIC_URLNoPublic base URL that build_map returns, e.g. https://maps.example.hk/

Instructions

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

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

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

Tools

Functions exposed to the LLM to take actions

NameDescription
search_hk_dataA

Search ALL ~1150 CSDI datasets locally (English or Chinese), ranked. No keyword = browse.

Chinese and English both work — Chinese terms are expanded with Hong Kong usage (廁所 -> 洗手間, 行人路 -> pedestrian, 電動車 -> electric vehicle charging, …). Returns dataset_id + bilingual title + why it matched. Feed dataset_id to load_hk_data().

load_hk_dataA

Download one CSDI dataset as GeoJSON (WGS84) into the workspace. Returns a SUMMARY, not the data itself — never paste the features into the chat, put them on a map with build_map(). The local copy is reused on later calls; pass refresh=True to re-download.

query_hk_dataA

Read a FEW individual features, so a single value can be verified without opening the GeoJSON.

where is either FIELD=value (case-insensitive match on one field) or bare text searched across all fields. Rows are capped at 20 — this tool exists to check a value, not to dump a dataset; use summarise_hk_data for aggregates and build_map to see the layer.

summarise_hk_dataA

Answer a question about a dataset in TEXT (and a bar chart), without putting features in the chat.

  • group_by empty: an overview — feature count, geometry, which fields are worth grouping by.

  • group_by="NAME_OF_DISTRICT_COUNCIL_DISTRICT_EN" with agg="count": how many features per group.

  • agg="sum" / "avg" with value_field="MEDIUM_IEC62196_no": totals or averages per group. Returns an aligned text table, the same rows as data, and a chart URL served on localhost.

build_mapB

Build an interactive 2D web map (ArcGIS Maps SDK, keyless basemap) from loaded datasets and serve it on localhost. Open the returned URL in your client's browser or preview pane.

build_sceneA

Same datasets, rendered in a 3D scene: terrain relief, tilted camera, layers draped on the ground. Keyless (public imagery + Terrain3D elevation). Use it when relief, height or a walk-through view matters — towers, slopes, trails, coastal context.

geocode_addressA

Geocode an address/place to coordinates, or reverse-geocode a coordinate to an address. Esri public world geocoder — no key required. Reverse mode: pass lon and lat.

geometry_opA

Project, buffer or simplify one GeoJSON geometry with Esri's public Geometry service — no key.

operation: "project" (in_sr -> out_sr, e.g. 2326 -> 4326), "buffer" (distance in unit), "simplify" (max_deviation in the input SR's units).

elevation_atB

Ground elevation in metres at a coordinate, from Esri's public Terrain3D service — no key. Handy for hiking/relief context (e.g. trail comfort, slope warnings) alongside CSDI layers.

export_static_mapA

Render a basemap-only PNG (no key) into the workspace — for reports, decks and docs. Give either bbox ("minx,miny,maxx,maxy" in EPSG:4326) or center + zoom. NOTE: CSDI features are NOT drawn on this image; use build_map for the interactive version, or an ArcGIS Online print service (needs ARCGIS_TOKEN) for data-on-basemap statics.

export_static_svgB

Write a printable static map WITH the data drawn, as one self-contained SVG page.

Basemap tiles are referenced by URL (they load in any browser with internet), features are drawn as real vector shapes on top — so the result prints cleanly to PDF from the browser's print dialog. No key, no headless browser, no image library.

arcgis_requestB

Call any ArcGIS Online REST endpoint with the configured token.

Examples: path="search", params={"q": 'title:"my layer"', "num": 5} → find items path="content/items//data", params={} → item JSON path="content/items/", params={} → item metadata path="/0/query", params={"where":"1=1","outFields":"*","f":"json","returnCountOnly":"true"} → count analysis: run a GP task under //submitJob (then /jobs/)

publish_layerA

Publish a loaded CSDI dataset to ArcGIS Online as a hosted feature layer. Needs ARCGIS_TOKEN. Returns itemId + the new service URL.

dataset_statusA

Are these datasets still being served, and how stale are they?

No dataset_id -> lists the limit oldest datasets in the catalogue, so you can see drift at a glance. probe=True also calls the CSDI export endpoint to confirm it answers right now (reads 2 KB only, costs a round trip each — capped at 10 per call).

Treat catalogue date and data freshness as SEPARATE things: the date below is CSDI's dct:modified (when the record was revised), not the statistical reference period of the data.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.5/5.0

Scored across 14 tools

Disambiguation4/5

The core pipeline is clearly staged: search_hk_data -> load_hk_data -> query_hk_data / summarise_hk_data -> build_map / build_scene, with each step's role spelled out (verify a value vs. aggregate vs. visualize). The only real soft spots are the three output tools (build_map, export_static_map, export_static_svg), differentiated mainly by paragraph-level caveats rather than by name, and arcgis_request, which is a generic escape hatch that can duplicate geocode/publish/query functions.

Naming Consistency3/5

Most tools are verb_noun (search_hk_data, load_hk_data, build_map, export_static_map, publish_layer), with a nice *_hk_data family for the data lifecycle. But four tools break the verb-first pattern entirely (geometry_op, elevation_at, arcgis_request, dataset_status), and the hk_ prefix is applied inconsistently to the geo tools, so the convention is readable but not predictable.

Tool Count4/5

Fourteen tools is a reasonable, well-scoped size for a geospatial data server covering discovery, retrieval, analysis, visualization and publishing. There is mild redundancy in having three separate map-output tools (interactive, PNG, SVG), one of which is basemap-only and arguably an edge case.

Completeness4/5

The surface covers the full discovery-to-output lifecycle plus analysis helpers (geocode, buffer/project/simplify, elevation), raw REST access and a data-freshness check — no dead ends for the stated purpose. Minor gaps: no tool to list or clean up datasets already loaded in the workspace, and no way to export a filtered subset back out as data (CSV/GeoJSON) rather than an image or map.

Maintenance

ActivityMaintained
ResponsivenessNo issues