MapScale

v0.1.0
io.github.realtytable/mapscale Checked 2 days ago Published 3 days ago

Thailand maps, geocoding, autocomplete, routing, and MapLibre quickstarts.

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

mapscale_products MapScale products and key requirements

Lists MapScale's products (APIs, SDKs, datasets and tools) with what each does, whether it needs an API key, and its docs URL. Optional filter by need.

ParameterTypeDescription
needstringOptional keyword filter, e.g. "autocomplete", "routing", "wordpress", "react native". MCP client UTF-8 budget: 512 bytes.

mapscale_thailand_quickstart Thailand map quickstart

Returns copy-paste code for adding a MapLibre map of Thailand to a project: a complete, working example for maplibre-html, next, react, or react-native, including a keyless demo path (OpenStreetMap-based PMTiles) and the hosted style URL path that needs a MapScale publishable key. Useful when a project needs a Thailand basemap with Thai or English labels.

ParameterTypeDescription
frameworkstringWhich framework's quickstart to return. MCP client UTF-8 budget: 512 bytes.

mapscale_style_url MapLibre style URL

Build the MapScale MapLibre style URL (self-contained: tiles+glyphs on the same origin). Drop straight into `new maplibregl.Map({ style })`. Params: lang (th/en), accent (6-digit hex), hide (layer groups).

ParameterTypeDescription
accentstring6-digit hex, # optional (e.g. 0c4a4a) MCP client UTF-8 budget: 512 bytes.
hidearray
langstringMCP client UTF-8 budget: 512 bytes.

mapscale_newsroom_map Make a Thailand map by link

Make a choropleth map of Thailand by province or district with NO API key and no studio clicks: returns the MapScale newsroom studio link, a bare-map link, ready-to-paste responsive embed code and SVG/PNG image links, for a curated dataset (elderly share, rainfall, income, population density, forest, rice...) or the user's own numbers by province/district name (English or Thai). Free for editorial use with a 'Map: MapScale' credit linking to mapscale.io. Use for any "map these numbers" / "map X across Thailand" request from a journalist or writer.

ParameterTypeDescription
captionstringText under the map (max 300 characters). Never write numbers: use placeholders such as {TH50.value}, {TH50.change}, {TH50.name}, {TH50.rank}, {median.value}, {median.change}, {year}, {compareYear}, {u…
chartstringWhich chart tab opens by default in the studio and embed (datasets with history). MCP client UTF-8 budget: 512 bytes.
colorsstringColour ramp. MCP client UTF-8 budget: 512 bytes.
compareintegerDatasets with history: a second year. The map then shows the CHANGE (year minus compare), with a diverging cool-warm palette centred on 0. Example: dataset=warming, year=2024, compare=1950.
dataarrayThe user's own numbers, one per province or district: [{place, value}]. place is an English or Thai name or a PCODE such as TH10.
datasetstringCurated Thailand dataset: population, elderly, rain (3-month rainfall vs normal), rainfall-normal, income, city (built-up share), forest, farms, rice, durian (registered durian-growing households by p…
focusarrayZoom to these provinces (PCODEs like TH50 or names); wins over region.
highlightarrayProvinces (PCODEs like TH10 or names) to outline and label with name and value.
langstringMap label language. MCP client UTF-8 budget: 512 bytes.
localestringLanguage of the studio page the links open. MCP client UTF-8 budget: 512 bytes.
notesarrayCallouts pinned to provinces: [{pcode, text}] (text max 80 characters, no statistics).
playbooleanEmbed link only: play the year-by-year animation once when the map loads (datasets with history).
pointsarrayPoint data instead of regions: [{lat, lng, label?, value?}].
regionstringZoom to one of the six regions; the rest of Thailand is drawn pale. MCP client UTF-8 budget: 512 bytes.
shapestringEmbed and image shape. MCP client UTF-8 budget: 512 bytes.
sourcestringThe data source the journalist should credit (max 300 characters). MCP client UTF-8 budget: 512 bytes.
statsarrayBig-number cards under the map: [{pcode, metric: value|change, label?}]. The number comes from the data.
stylestringMap look; light and dark also work. MCP client UTF-8 budget: 512 bytes.
subtitlestringMap subtitle (max 200 characters). MCP client UTF-8 budget: 512 bytes.
titlestringMap title (max 200 characters). MCP client UTF-8 budget: 512 bytes.
topintegerBars in the ranking chart.
valuesbooleanLabel every province with its value.
yearintegerYear to show for a dataset with history (it has a year slider, province charts and an animated GIF in the studio): warming and temperature 1900-2024, pm25 and unhealthy-air 2024-2025, flood-extent 200…

mapscale_status MapScale API status

Check the MapScale API's health/dependency status (public endpoint, no key).

mapscale_geocode Geocode a Thai address

Geocode a query to coordinates. Accepts Thai-script or English queries (addresses, POIs, Thai administrative areas such as province, district and subdistrict) and returns a Mapbox-shaped GeoJSON FeatureCollection built on OpenStreetMap data. Requires a secret (sk_) key.

ParameterTypeDescription
q *stringFree-text query, e.g. "siam paragon" or "ซีคอน สแควร์" MCP client UTF-8 budget: 2048 bytes.
bboxstringminLng,minLat,maxLng,maxLat bias MCP client UTF-8 budget: 128 bytes.
countrystringISO-2 filter, e.g. TH MCP client UTF-8 budget: 512 bytes.
langstringResult language MCP client UTF-8 budget: 512 bytes.
limitinteger
proximitystring"lng,lat" bias MCP client UTF-8 budget: 128 bytes.

mapscale_reverse Reverse geocode

Reverse-geocode a lng,lat point (Thai admin areas, addresses).

ParameterTypeDescription
point *string"lng,lat" e.g. "100.5018,13.7563" MCP client UTF-8 budget: 128 bytes.
langstringMCP client UTF-8 budget: 512 bytes.

mapscale_autocomplete Address autocomplete

Address/place autocomplete session call — Google Places-shaped {predictions:[…]} for building a Thai address search box. Pass a stable session_token per user session.

ParameterTypeDescription
q *stringMCP client UTF-8 budget: 2048 bytes.
langstringMCP client UTF-8 budget: 512 bytes.
limitinteger
session_tokenstringMCP client UTF-8 budget: 512 bytes.

mapscale_place Place details

Fetch full place details by id from geocode/autocomplete results (photon:… or places uuids).

ParameterTypeDescription
id *stringMCP client UTF-8 budget: 512 bytes.

mapscale_route Route between points

Driving/walking route between waypoints (Thailand-tuned Valhalla). Mapbox-shaped response. Coordinates are [lng, lat] pairs.

ParameterTypeDescription
coordinates *array2..25 [lng, lat] pairs, start to end (MCP client budget)
profilestringMCP client UTF-8 budget: 512 bytes.

mapscale_matrix Travel-time matrix

Travel-time/distance matrix (≤25×25) — logistics, store-finder sort. sources and targets are [lng, lat] pair arrays.

ParameterTypeDescription
sources *array
targets *array
profilestringMCP client UTF-8 budget: 512 bytes.

mapscale_isochrone Isochrone (reachable area)

Isochrone contours around a point as GeoJSON — contours in minutes ("5,10,15") or kilometers ("1km,2km").

ParameterTypeDescription
point *string"lng,lat" MCP client UTF-8 budget: 128 bytes.
contoursstring"5,10,15" or "1km,2km" MCP client UTF-8 budget: 512 bytes.
profilestringMCP client UTF-8 budget: 512 bytes.

mapscale_datasets_list List your datasets

List the datasets uploaded to your MapScale account (GeoJSON served as vector tiles). Each entry has id, name, slug, tilesetId (ds_<uuid>), feature count, geometry type and bbox. Requires a secret (sk_) key and an API deployment with the datasets endpoint.

mapscale_dataset_upload Upload a GeoJSON dataset

Upload a small GeoJSON FeatureCollection (WGS84, up to 1000 features and 256 KB inline) as a dataset and serve it as vector tiles at /tiles/v1/ds_<id>/{z}/{x}/{y}.mvt. Larger files: POST to /v1/datasets directly. Requires a secret (sk_) key. Creates a stored dataset, so confirm with the user first.

ParameterTypeDescription
geojson *objectGeoJSON FeatureCollection, e.g. {"type":"FeatureCollection","features":[...]}. A JSON string is also accepted.
name *stringDisplay name, 1-120 characters. MCP client UTF-8 budget: 512 bytes.
publicbooleanLet any key read the tiles. Default false (private to your account).
slugstringOptional layer name inside the tiles: lowercase letters, digits, - and _. Defaults to a slug of name. MCP client UTF-8 budget: 512 bytes.

mapscale_catalog Thailand data catalog

Browse the MapScale Thailand data catalog (hazard, boundary and reference layers). Without an id returns the layer list; with an id returns that layer's details. Requires an API deployment with the catalog endpoint.

ParameterTypeDescription
idstringOptional catalog layer id from the list. MCP client UTF-8 budget: 512 bytes.

mapscale_analysis Spatial analysis

Run a spatial analysis on GeoJSON: buffer, aggregate, nearest or intersect. `params` is the JSON request body for that operation, as documented in the MapScale analysis reference (https://mapscale.io/docs). Requires a secret (sk_) key and an API deployment with the analysis endpoints.

ParameterTypeDescription
operation *stringMCP client UTF-8 budget: 512 bytes.
params *objectJSON body for the chosen operation.

mapscale_styles_list List saved styles

List the saved map styles in your MapScale account. Each can be loaded in MapLibre from its /styles/v1/st_<id> URL. Requires a secret (sk_) key and an API deployment with the styles endpoint.

mapscale_places_nearby Nearby places

Find MapScale POIs near a point, ordered by crow-fly distance (baseScore is metres). Optional `types` filter is comma-separated POI types. Requires an API key.

ParameterTypeDescription
point *string"lng,lat" e.g. "100.5018,13.7563" MCP client UTF-8 budget: 128 bytes.
langstringMCP client UTF-8 budget: 512 bytes.
limitinteger
radiusintegerMetres.
typesstringComma-separated POI types to keep. MCP client UTF-8 budget: 512 bytes.

mapscale_place_by_slug Place by slug

Resolve one MapScale POI or custom area by its stable URL slug (custom areas include their polygon and bounding box). Requires an API key.

ParameterTypeDescription
slug *stringStable place slug, up to 255 characters. MCP client UTF-8 budget: 512 bytes.
langstringMCP client UTF-8 budget: 512 bytes.

mapscale_admin_area_reverse Admin area at a point

Point-in-polygon lookup: the Thai administrative area (province, district, subdistrict) containing a lng,lat point. Requires an API key.

ParameterTypeDescription
point *string"lng,lat" e.g. "100.5018,13.7563" MCP client UTF-8 budget: 128 bytes.
langstringMCP client UTF-8 budget: 512 bytes.

mapscale_environmental Environmental data

Environmental data lookups, chosen by `op`. admin_area_metrics: latest metric per admin area (areas [{level, code}], metrics [keys], optional as_of). flood_exposure: flood-event recurrence for up to 500 keyed points. elevation: Copernicus GLO-30 elevation for up to 500 keyed points. waterways: hydrography GeoJSON in a bbox. sources: provenance and coverage of the environmental datasets. All operations only read data. Requires an API key.

ParameterTypeDescription
op *stringMCP client UTF-8 budget: 512 bytes.
areasarrayadmin_area_metrics: [{level: country|province|district|subdistrict, code}].
as_ofstringadmin_area_metrics: ISO 8601 date-time for a point-in-time read. MCP client UTF-8 budget: 512 bytes.
bboxstringwaterways: "minLng,minLat,maxLng,maxLat". MCP client UTF-8 budget: 128 bytes.
datasetsstringsources: comma-separated dataset filter. MCP client UTF-8 budget: 512 bytes.
event_keysarrayflood_exposure: optional flood event keys to restrict to.
kindsstringwaterways: comma-separated waterway kinds. MCP client UTF-8 budget: 512 bytes.
limitintegerwaterways 1..5000 (default 1000); sources 1..200 (default 100).
metricsarrayadmin_area_metrics: metric keys, lowercase [a-z0-9_.-].
pointsarrayflood_exposure and elevation: [{key, lat, lng}] with caller-chosen keys.
source_versionstringwaterways: pin a source release. MCP client UTF-8 budget: 512 bytes.

mapscale_static_map Static map image URL

Build the URL of a static PNG map of Thailand (no download, no network call) plus a markdown image line. Give `center` [lng, lat] and `zoom`; optional size, retina, labels language, accent colour and up to 24 markers. The URL carries the key as `?key=` only when a publishable pk_ key is configured, otherwise a pk_live_YOUR_KEY placeholder.

ParameterTypeDescription
center *array[longitude, latitude]
accentstring6-digit hex, # optional (e.g. 0c4a4a) MCP client UTF-8 budget: 512 bytes.
heightinteger
langstringMCP client UTF-8 budget: 512 bytes.
markersarray
retinabooleanRender at 2x pixel density.
widthinteger
zoomnumber

mapscale_assistant_plan Plan map actions from a sentence

Turn a sentence (English or Thai) into up to three validated map actions: style, buffer/aggregate/nearest analysis, ranking, or a clarifying question. With a secret key and dataset_ids (1-4 dataset UUIDs) it plans against your datasets. Without a key it answers against a fixed 12-shop demo dataset (prompt up to 300 characters, rate limited).

ParameterTypeDescription
prompt *stringRequest, e.g. 'color the stores by visits'. MCP client UTF-8 budget: 512 bytes.
currentobjectStyle currently applied, for follow-ups: {kind, property}.
dataset_idsarrayDataset UUIDs from mapscale_datasets_list. Needs a secret key.
localestringMCP client UTF-8 budget: 512 bytes.

mapscale_atlas Thailand public atlas

Public Thailand atlas data (no key needed), chosen by `op`. catalog: layer registry. province_metrics: latest environmental metrics per province. traffic_incidents: current traffic incidents. snapshot: layer metadata for a bbox (bbox, layers). layer: GeoJSON for one catalog layer with delivery vector (layer_id, bbox); base-map, admin-boundaries and places are style layers (delivery style) and are not returned as features. intelligence: server intelligence layers for a bbox (bbox, ids). cameras: public camera catalogue (optional bbox). air_quality_history: OpenAQ series (location_id, sensor_id,…

ParameterTypeDescription
op *stringMCP client UTF-8 budget: 512 bytes.
atstringsnapshot, intelligence: ISO 8601 date-time. MCP client UTF-8 budget: 512 bytes.
bboxstring"minLng,minLat,maxLng,maxLat"; viewports up to 2 degrees. MCP client UTF-8 budget: 128 bytes.
cursorstringlayer, air_quality_history: nextCursor from a prior page. MCP client UTF-8 budget: 512 bytes.
fromstringlayer, air_quality_history: ISO 8601 date-time. MCP client UTF-8 budget: 512 bytes.
idsstringintelligence: comma-separated intelligence ids (fires, events, factories, pollution, wind, waves, water, roads, noise, subsidence, flood-risk, population, income, condos, moobans, companies, tsunami,…
industrystringintelligence: industry filter. MCP client UTF-8 budget: 512 bytes.
latnumberforecast: latitude.
layer_idstringlayer: layer id from the catalog. MCP client UTF-8 budget: 512 bytes.
layersstringsnapshot: comma-separated layer ids (up to 4). MCP client UTF-8 budget: 512 bytes.
limitintegerlayer and air_quality_history: 1..500 (default 250).
lngnumberforecast: longitude.
location_idintegerair_quality_history: OpenAQ location id.
project_idstringproject_site: project UUID. MCP client UTF-8 budget: 512 bytes.
provincestringintelligence: province filter. MCP client UTF-8 budget: 512 bytes.
sensor_idintegerair_quality_history: OpenAQ sensor id.
simulatedstringintelligence: comma-separated simulated layer ids. MCP client UTF-8 budget: 512 bytes.
stop_idstringbus_stop: stop id. MCP client UTF-8 budget: 512 bytes.
tostringlayer, air_quality_history: ISO 8601 date-time. MCP client UTF-8 budget: 512 bytes.

mapscale_intelligence MapScale Intelligence (read)

Read MapScale Intelligence data for one product (land, civic or defense), chosen by `op`: search (q), overview, usage (usage and limits), or a listing of entities, evidence, reports, alerts, assessments, incidents, dependencies, cases, watches or jobs (optional cursor); report returns one report by id. Read-only. Requires a secret (sk_) key with Intelligence access.

ParameterTypeDescription
op *stringMCP client UTF-8 budget: 512 bytes.
product *stringMCP client UTF-8 budget: 512 bytes.
cursorstringListings: nextCursor UUID from a prior page. MCP client UTF-8 budget: 512 bytes.
idstringreport: report UUID. MCP client UTF-8 budget: 512 bytes.
qstringsearch: query, 2-200 characters. MCP client UTF-8 budget: 2048 bytes.

mapscale_show_thailand_map Show a map of Thailand

Show an interactive map of Thailand inline (MapLibre on OpenStreetMap data). Give a `place` (a major Thai city/province such as Bangkok, Chiang Mai, Phuket — other places need a MapScale key) or an explicit `center` [lng, lat], plus an optional `zoom` (1-18) and `markers` ([{lng, lat, name}]). Use for any "show me X on a map" request about Thailand.

ParameterTypeDescription
centerarray[longitude, latitude]; overrides `place`.
markersarray
placestringPlace name, e.g. 'Chiang Mai'. MCP client UTF-8 budget: 512 bytes.
titlestringShort caption shown on the map. MCP client UTF-8 budget: 512 bytes.
zoomnumberDefault 11.