MapScale
v0.1.0Thailand 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.
| Parameter | Type | Description |
|---|---|---|
need | string | Optional 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.
| Parameter | Type | Description |
|---|---|---|
framework | string | Which 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).
| Parameter | Type | Description |
|---|---|---|
accent | string | 6-digit hex, # optional (e.g. 0c4a4a) MCP client UTF-8 budget: 512 bytes. |
hide | array | |
lang | string | MCP 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.
| Parameter | Type | Description |
|---|---|---|
caption | string | Text 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… |
chart | string | Which chart tab opens by default in the studio and embed (datasets with history). MCP client UTF-8 budget: 512 bytes. |
colors | string | Colour ramp. MCP client UTF-8 budget: 512 bytes. |
compare | integer | Datasets 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. |
data | array | The user's own numbers, one per province or district: [{place, value}]. place is an English or Thai name or a PCODE such as TH10. |
dataset | string | Curated 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… |
focus | array | Zoom to these provinces (PCODEs like TH50 or names); wins over region. |
highlight | array | Provinces (PCODEs like TH10 or names) to outline and label with name and value. |
lang | string | Map label language. MCP client UTF-8 budget: 512 bytes. |
locale | string | Language of the studio page the links open. MCP client UTF-8 budget: 512 bytes. |
notes | array | Callouts pinned to provinces: [{pcode, text}] (text max 80 characters, no statistics). |
play | boolean | Embed link only: play the year-by-year animation once when the map loads (datasets with history). |
points | array | Point data instead of regions: [{lat, lng, label?, value?}]. |
region | string | Zoom to one of the six regions; the rest of Thailand is drawn pale. MCP client UTF-8 budget: 512 bytes. |
shape | string | Embed and image shape. MCP client UTF-8 budget: 512 bytes. |
source | string | The data source the journalist should credit (max 300 characters). MCP client UTF-8 budget: 512 bytes. |
stats | array | Big-number cards under the map: [{pcode, metric: value|change, label?}]. The number comes from the data. |
style | string | Map look; light and dark also work. MCP client UTF-8 budget: 512 bytes. |
subtitle | string | Map subtitle (max 200 characters). MCP client UTF-8 budget: 512 bytes. |
title | string | Map title (max 200 characters). MCP client UTF-8 budget: 512 bytes. |
top | integer | Bars in the ranking chart. |
values | boolean | Label every province with its value. |
year | integer | Year 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.
| Parameter | Type | Description |
|---|---|---|
q * | string | Free-text query, e.g. "siam paragon" or "ซีคอน สแควร์" MCP client UTF-8 budget: 2048 bytes. |
bbox | string | minLng,minLat,maxLng,maxLat bias MCP client UTF-8 budget: 128 bytes. |
country | string | ISO-2 filter, e.g. TH MCP client UTF-8 budget: 512 bytes. |
lang | string | Result language MCP client UTF-8 budget: 512 bytes. |
limit | integer | |
proximity | string | "lng,lat" bias MCP client UTF-8 budget: 128 bytes. |
mapscale_reverse Reverse geocode
Reverse-geocode a lng,lat point (Thai admin areas, addresses).
| Parameter | Type | Description |
|---|---|---|
point * | string | "lng,lat" e.g. "100.5018,13.7563" MCP client UTF-8 budget: 128 bytes. |
lang | string | MCP 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.
| Parameter | Type | Description |
|---|---|---|
q * | string | MCP client UTF-8 budget: 2048 bytes. |
lang | string | MCP client UTF-8 budget: 512 bytes. |
limit | integer | |
session_token | string | MCP client UTF-8 budget: 512 bytes. |
mapscale_place Place details
Fetch full place details by id from geocode/autocomplete results (photon:… or places uuids).
| Parameter | Type | Description |
|---|---|---|
id * | string | MCP 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.
| Parameter | Type | Description |
|---|---|---|
coordinates * | array | 2..25 [lng, lat] pairs, start to end (MCP client budget) |
profile | string | MCP 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.
| Parameter | Type | Description |
|---|---|---|
sources * | array | |
targets * | array | |
profile | string | MCP 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").
| Parameter | Type | Description |
|---|---|---|
point * | string | "lng,lat" MCP client UTF-8 budget: 128 bytes. |
contours | string | "5,10,15" or "1km,2km" MCP client UTF-8 budget: 512 bytes. |
profile | string | MCP 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.
| Parameter | Type | Description |
|---|---|---|
geojson * | object | GeoJSON FeatureCollection, e.g. {"type":"FeatureCollection","features":[...]}. A JSON string is also accepted. |
name * | string | Display name, 1-120 characters. MCP client UTF-8 budget: 512 bytes. |
public | boolean | Let any key read the tiles. Default false (private to your account). |
slug | string | Optional 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.
| Parameter | Type | Description |
|---|---|---|
id | string | Optional 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.
| Parameter | Type | Description |
|---|---|---|
operation * | string | MCP client UTF-8 budget: 512 bytes. |
params * | object | JSON 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_search Search places
Search MapScale's own places index: POIs, admin areas (province, district, subdistrict), custom areas and major streets. Returns ranked candidates with stable feature keys. `types` is a comma-separated filter (e.g. condo,school,province). Requires an API key.
| Parameter | Type | Description |
|---|---|---|
q * | string | Search text, 1-120 characters. MCP client UTF-8 budget: 2048 bytes. |
lang | string | Result language. MCP client UTF-8 budget: 512 bytes. |
limit | integer | |
province_ids | string | Comma-separated province ids to restrict to. MCP client UTF-8 budget: 512 bytes. |
types | string | Comma-separated place types to keep. MCP client UTF-8 budget: 512 bytes. |
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.
| Parameter | Type | Description |
|---|---|---|
point * | string | "lng,lat" e.g. "100.5018,13.7563" MCP client UTF-8 budget: 128 bytes. |
lang | string | MCP client UTF-8 budget: 512 bytes. |
limit | integer | |
radius | integer | Metres. |
types | string | Comma-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.
| Parameter | Type | Description |
|---|---|---|
slug * | string | Stable place slug, up to 255 characters. MCP client UTF-8 budget: 512 bytes. |
lang | string | MCP 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.
| Parameter | Type | Description |
|---|---|---|
point * | string | "lng,lat" e.g. "100.5018,13.7563" MCP client UTF-8 budget: 128 bytes. |
lang | string | MCP 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.
| Parameter | Type | Description |
|---|---|---|
op * | string | MCP client UTF-8 budget: 512 bytes. |
areas | array | admin_area_metrics: [{level: country|province|district|subdistrict, code}]. |
as_of | string | admin_area_metrics: ISO 8601 date-time for a point-in-time read. MCP client UTF-8 budget: 512 bytes. |
bbox | string | waterways: "minLng,minLat,maxLng,maxLat". MCP client UTF-8 budget: 128 bytes. |
datasets | string | sources: comma-separated dataset filter. MCP client UTF-8 budget: 512 bytes. |
event_keys | array | flood_exposure: optional flood event keys to restrict to. |
kinds | string | waterways: comma-separated waterway kinds. MCP client UTF-8 budget: 512 bytes. |
limit | integer | waterways 1..5000 (default 1000); sources 1..200 (default 100). |
metrics | array | admin_area_metrics: metric keys, lowercase [a-z0-9_.-]. |
points | array | flood_exposure and elevation: [{key, lat, lng}] with caller-chosen keys. |
source_version | string | waterways: 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.
| Parameter | Type | Description |
|---|---|---|
center * | array | [longitude, latitude] |
accent | string | 6-digit hex, # optional (e.g. 0c4a4a) MCP client UTF-8 budget: 512 bytes. |
height | integer | |
lang | string | MCP client UTF-8 budget: 512 bytes. |
markers | array | |
retina | boolean | Render at 2x pixel density. |
width | integer | |
zoom | number |
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).
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Request, e.g. 'color the stores by visits'. MCP client UTF-8 budget: 512 bytes. |
current | object | Style currently applied, for follow-ups: {kind, property}. |
dataset_ids | array | Dataset UUIDs from mapscale_datasets_list. Needs a secret key. |
locale | string | MCP 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,…
| Parameter | Type | Description |
|---|---|---|
op * | string | MCP client UTF-8 budget: 512 bytes. |
at | string | snapshot, intelligence: ISO 8601 date-time. MCP client UTF-8 budget: 512 bytes. |
bbox | string | "minLng,minLat,maxLng,maxLat"; viewports up to 2 degrees. MCP client UTF-8 budget: 128 bytes. |
cursor | string | layer, air_quality_history: nextCursor from a prior page. MCP client UTF-8 budget: 512 bytes. |
from | string | layer, air_quality_history: ISO 8601 date-time. MCP client UTF-8 budget: 512 bytes. |
ids | string | intelligence: comma-separated intelligence ids (fires, events, factories, pollution, wind, waves, water, roads, noise, subsidence, flood-risk, population, income, condos, moobans, companies, tsunami,… |
industry | string | intelligence: industry filter. MCP client UTF-8 budget: 512 bytes. |
lat | number | forecast: latitude. |
layer_id | string | layer: layer id from the catalog. MCP client UTF-8 budget: 512 bytes. |
layers | string | snapshot: comma-separated layer ids (up to 4). MCP client UTF-8 budget: 512 bytes. |
limit | integer | layer and air_quality_history: 1..500 (default 250). |
lng | number | forecast: longitude. |
location_id | integer | air_quality_history: OpenAQ location id. |
project_id | string | project_site: project UUID. MCP client UTF-8 budget: 512 bytes. |
province | string | intelligence: province filter. MCP client UTF-8 budget: 512 bytes. |
sensor_id | integer | air_quality_history: OpenAQ sensor id. |
simulated | string | intelligence: comma-separated simulated layer ids. MCP client UTF-8 budget: 512 bytes. |
stop_id | string | bus_stop: stop id. MCP client UTF-8 budget: 512 bytes. |
to | string | layer, 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.
| Parameter | Type | Description |
|---|---|---|
op * | string | MCP client UTF-8 budget: 512 bytes. |
product * | string | MCP client UTF-8 budget: 512 bytes. |
cursor | string | Listings: nextCursor UUID from a prior page. MCP client UTF-8 budget: 512 bytes. |
id | string | report: report UUID. MCP client UTF-8 budget: 512 bytes. |
q | string | search: 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.
| Parameter | Type | Description |
|---|---|---|
center | array | [longitude, latitude]; overrides `place`. |
markers | array | |
place | string | Place name, e.g. 'Chiang Mai'. MCP client UTF-8 budget: 512 bytes. |
title | string | Short caption shown on the map. MCP client UTF-8 budget: 512 bytes. |
zoom | number | Default 11. |