Skip to Content
teigeodata
Reference

MCP tools

Every tool and resource of tgd mcp with its arguments and answer, generated from the server's own definitions.

What tools/list and resources/templates/list give, with the bounds of a server's default limits. Every answer is structured content that its tool's output schema accepts, the same object as text, with the attribution under _meta too. How to run the server and connect a client: MCP server.

The server's instructions to a client:

Offline place data. Find places by name with search, by coordinates with reverse and admin_at, around a place with nearby; climb with hierarchy and descend with children. Places are named by IDs such as tgd:np/1xhb: pass them to get_place, lookup, nearby, timezone or read teigeodata://place/{id}. Coordinates are WGS84 degrees, distances metres, heights metres above EGM2008. A long answer has a next_cursor: call the same tool with only cursor for the next page. Show the attribution of an answer wherever its data is shown: the licences require it.

Tools

ToolWhat
searchSearch places by name
reversePlaces nearest a point
nearbyPlaces near a place
get_placeA place by ID
lookupPlaces by IDs
admin_atAdmin units at a point
hierarchyAncestors of a place
childrenChildren of a place
timezoneTimezone
elevationTerrain height
postalPostal codes
boundaryOutline of a place
distanceDistance and bearing
packsInstalled packs
coveragePacks for a point
installInstall packs
install_statusHow an install goes

Search places by name. Places matching a name, best first. "Name, Parent" ranks places under a parent of that name first. focus ranks places near a point higher (scale_km: how far counts as near, default 50). strict ranks by how well the name matched (exact, then loose, prefix, one edit) before importance and nearness.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
querystringyesThe name, in any script, such as Pokhara or पोखरा. 1 to 256 bytes.
cursorstringThe next_cursor of the previous page; the other arguments are then taken from it.
focusobject
focus.latnumberyesLatitude, WGS84 degrees. -90 to 90.
focus.lonnumberyesLongitude, WGS84 degrees. -180 to 180.
focus.scale_kmnumberOver 0; default 50.
limitintegerHow many results, the page's size. 0 to 50; default 10.
strictbooleanRank by match quality first. Default false.

Answers places, a page at a time.

reverse

Places nearest a point. The places nearest a point, nearest first, each with its distance in metres, its bearing, and whether its outline holds the point. in_country: only places in the country holding the point.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
latnumberyesLatitude, WGS84 degrees. -90 to 90.
lonnumberyesLongitude, WGS84 degrees. -180 to 180.
cursorstringThe next_cursor of the previous page; the other arguments are then taken from it.
in_countrybooleanDefault false.
limitintegerHow many results, the page's size. 0 to 50; default 10.

Answers places, a page at a time.

nearby

Places near a place. The places nearest a place, nearest first, the place itself left out; within radius_m metres when given.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
idstringyesA place ID from an earlier answer, such as tgd:np/1xhb. 1 to 256 bytes.
cursorstringThe next_cursor of the previous page; the other arguments are then taken from it.
limitintegerHow many results, the page's size. 0 to 50; default 10.
radius_mnumberMetres. 0 to 1000000.0.

Answers places, a page at a time.

get_place

A place by ID. One place by its ID; names: every name it has, with language and origin. A retired ID answers its survivor.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
idstringyesA place ID from an earlier answer, such as tgd:np/1xhb. 1 to 256 bytes.
namesbooleanDefault false.

Answers places, a page at a time.

lookup

Places by IDs. Places by ID, in the order asked; IDs not found are left out.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
idsarray of stringyes1 to 50 items.

Answers places, a page at a time.

admin_at

Admin units at a point. The admin units holding a point, the country first, then each finer level.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
latnumberyesLatitude, WGS84 degrees. -90 to 90.
lonnumberyesLongitude, WGS84 degrees. -180 to 180.

Answers places, a page at a time.

hierarchy

Ancestors of a place. A place's ancestors: its parent first, then the parent's, up to the country.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
idstringyesA place ID from an earlier answer, such as tgd:np/1xhb. 1 to 256 bytes.

Answers places, a page at a time.

children

Children of a place. The places whose parent is a place, such as a country's provinces or a district's municipalities.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
idstringyesA place ID from an earlier answer, such as tgd:np/1xhb. 1 to 256 bytes.
cursorstringThe next_cursor of the previous page; the other arguments are then taken from it.
limitintegerHow many results, the page's size. 0 to 50; default 10.

Answers places, a page at a time.

timezone

Timezone. The IANA timezone of a place (id) or at a point (lat, lon), with its UTC offset, abbreviation and DST at instant t (Unix seconds, default now).

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
idstringA place ID from an earlier answer, such as tgd:np/1xhb. 1 to 256 bytes.
latnumberLatitude, WGS84 degrees. -90 to 90.
lonnumberLongitude, WGS84 degrees. -180 to 180.
tintegerUnix seconds.

Answers places, a page at a time.

elevation

Terrain height. The terrain height at a point, metres above the EGM2008 geoid, from the packs' elevation model; null where there is none.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
latnumberyesLatitude, WGS84 degrees. -90 to 90.
lonnumberyesLongitude, WGS84 degrees. -180 to 180.

Answers:

FieldTypeWhat
attributionstring or null
resultobject
result.datumstring
result.elevation_mnumber or null
result.latnumber
result.lonnumber
result.resolution_mnumber
result.sourcestring or null

postal

Postal codes. Postal codes: a code to its places (code, optionally its scheme such as NP or IN-PIN), codes starting with code (prefix), or the codes at a point (lat, lon).

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
codestring1 to 256 bytes.
latnumberLatitude, WGS84 degrees. -90 to 90.
limitintegerHow many results, the page's size. 0 to 50; default 10.
lonnumberLongitude, WGS84 degrees. -180 to 180.
prefixbooleanDefault false.
schemestringAt most 256 bytes.

Answers:

FieldTypeWhat
attributionstring or null
resultsarray of object
results[].admin_levelinteger
results[].codestring
results[].idstring
results[].kindstring
results[].namestring or null
results[].replacedboolean
results[].schemestring
results[].valid_frominteger or null
results[].valid_tointeger or null

boundary

Outline of a place. What a place's outline is: its level of detail (0 finest to 6 coarsest; the finest within the vertex bound when lod is not given), tolerance in metres, vertices, parts, holes and bounding box, and the uri of the outline itself as a GeoJSON resource, to read when it is drawn. A place with no outline answers outlined: false.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
idstringyesA place ID from an earlier answer, such as tgd:np/1xhb. 1 to 256 bytes.
lodinteger0 to 6.

Answers:

FieldTypeWhat
attributionstring or null
resultobject
result.bboxarray or nullWest, south, east, north. 4 to 4 items.
result.idstring
result.lodinteger
result.namestring or null
result.outlinedboolean
result.uristring
result.verticesinteger
result.holesinteger
result.partsinteger
result.tolerance_mnumber

distance

Distance and bearing. The great-circle distance in metres and initial bearing between two ends, each a place ID or a point as lat,lon.

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
fromstringyesA place ID such as tgd:np/1xhb, or a point such as 27.7172,85.324. 1 to 256 bytes.
tostringyesA place ID, or a point as lat,lon. 1 to 256 bytes.

Answers:

FieldTypeWhat
attributionstring or null
resultobject
result.bearingnumberDegrees clockwise from north.
result.fromobject
result.from.idstring or null
result.from.latnumber
result.from.lonnumber
result.metersnumber
result.toobject
result.to.idstring or null
result.to.latnumber
result.to.lonnumber

packs

Installed packs. The packs served: address, component, release, places, installed components and attribution.

Hints: read-only, idempotent.

No arguments.

Answers:

FieldTypeWhat
packsarray of object
packs[].addressstring
packs[].attributionstring or null
packs[].componentstring
packs[].componentsarray of string
packs[].placesinteger
packs[].releasestring

coverage

Packs for a point. The countries at a point or within radius_m metres of it, each with the catalog's packs that could hold the point: path, release, download and disk bytes, components, parts, licence and state (installed, update or available). From the store's verified catalog, offline.

Listed only by a server over a store (--store).

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
latnumberyesLatitude, WGS84 degrees. -90 to 90.
lonnumberyesLongitude, WGS84 degrees. -180 to 180.
radius_mintegerMetres; default 3,000. 0 to 1000000.0.

Answers:

FieldTypeWhat
attributionstring or null
resultsarray of object
results[].countriesarray of string
results[].idstring
results[].latnumber
results[].lonnumber
results[].namestring or null
results[].packsarray of object
results[].packs[].componentsarray of string
results[].packs[].diskinteger
results[].packs[].downloadinteger
results[].packs[].pathstring
results[].packs[].releasestring
results[].packs[].statestringOne of installed, update, available.
results[].packs[].licencestring
results[].packs[].partsarray of object

install

Install packs. Downloads packs from the catalog into the store, verified, and serves them: packs as catalog paths or addresses (np, np.places, ae-du), components (every one when none). The person confirms the download's size when the client can ask; otherwise the call is refused past max_bytes (default 100 MB), naming the size. Answers a task, or a handle for install_status.

Listed only by a server over a store that allows installs (--allow-install).

Hints: changes the store, idempotent, reaches the network.

ArgumentTypeRequiredWhat
packsarray of stringyes1 to 16 items.
componentsarray of string
max_bytesintegerThe most this call may download without the person's confirmation; default 100,000,000. At least 0.

Answers:

FieldTypeWhat
attributionnull
resultobject
result.statusstringOne of working, completed, failed, cancelled, declined.
result.downloadinteger
result.errorobject or null
result.handlestring
result.messagestring
result.packsarray of string
result.resultobject or null

install_status

How an install goes. Where the install of a handle (from install) is: working, completed, failed or cancelled, with its message and, once ended, what it installed or why it failed. Ask about once a second.

Listed only by a server over a store that allows installs (--allow-install).

Hints: read-only, idempotent.

ArgumentTypeRequiredWhat
handlestringyes32 to 32 bytes.

Answers:

FieldTypeWhat
attributionnull
resultobject
result.statusstringOne of working, completed, failed, cancelled, declined.
result.downloadinteger
result.errorobject or null
result.handlestring
result.messagestring
result.packsarray of string
result.resultobject or null

Places

The answer of every place tool: a page of results, the next_cursor of the next page when there is one, and the attribution of the packs that answered. A field a place lacks is left out or null.

FieldTypeWhat
attributionstring or nullThe credits of the packs that answered: show them wherever the data is shown.
resultsarray of object
results[].admin_levelinteger1 for a country's first-level units, deeper units after; 0 for a country and for a place that is not an admin unit.
results[].elevationinteger or nullMetres above EGM2008.
results[].idstringIts stable ID, such as tgd:np/1xhb.
results[].kindstring or nullIts kind, such as settlement or admin.
results[].namestring or nullIts canonical name.
results[].parentstring or nullIts parent's ID; null for a root.
results[].timezonestring or nullIts IANA timezone, such as Asia/Kathmandu.
results[].bearingnumberDegrees clockwise from north, from the place to the point asked about.
results[].elevation_sourcestringWhere the height came from: surveyed or model, when stated.
results[].insidebooleanWhether the point asked about is inside the place's outline (reverse).
results[].is_dstbooleanWhether daylight saving time is in force at that instant.
results[].iso_codestringIts ISO 3166 code, for a country or unit that has one.
results[].latnumberLatitude, WGS84 degrees.
results[].lonnumberLongitude, WGS84 degrees.
results[].metersnumberDistance from the point or place asked about, metres.
results[].namesarray of objectEvery name, canonical first (get_place with names).
results[].names[].machinebooleanMade by a machine (a romanisation, a transliteration or a donor label): an app may show it differently.
results[].names[].originstringWhere the name came from.
results[].names[].textstring
results[].names[].kindstringThe name's type.
results[].names[].langstringA BCP 47 tag, such as ne-Deva.
results[].populationintegerIts number of people, when known.
results[].population_kindstringWhere the number came from: stated (a source's count) or modelled (a population grid over an admin unit).
results[].scoreintegerIts search score, comparable only within one query.
results[].tz_abbrstringThe zone's abbreviation at that instant.
results[].utc_offsetstringThe UTC offset at the instant asked, such as +05:45 (timezone).
next_cursorstringPass as cursor to the same tool for the next page; absent on the last.

Resources

URI templateWhatType
teigeodata://place/{id}A place: A place by its ID (tgd:np/1xhb), with every name, as a GeoJSON featureapplication/geo+json
teigeodata://boundary/{id}{?lod}A place's outline: A place's outline as a GeoJSON feature, simplified to level of detail lod (0 finest to 6 coarsest)application/geo+json
teigeodata://dataset/{address}/{component}A pack: A pack (np/places): its release, places, installed components and attributionapplication/json

Errors

A tool that fails answers a tool error (isError) whose text is {"error": {"code": "...", "message": "..."}}, with the codes of the HTTP API.

On this page