Skip to main content
Glama

Resolve a pasted map link

resolve_map_url
Read-onlyIdempotent

Pasted Google/Apple/OpenStreetMap/geo: map link -> its coordinate and place.

Instructions

Pasted Google/Apple/OpenStreetMap/geo: map link -> its coordinate and place.

One call for the "meet here: https://maps.app.goo.gl/..." message: hand
over the link as pasted (scheme optional; a wrapping <...> and trailing
punctuation are tolerated) and get back {"lat", "lon", "provider"} plus
whatever the link itself carried — "zoom" when it had one, "label" when
it named a place or search ("Ferry Building", URL-decoded), "note" for a
directions link whose coordinate is only the viewport centre.

Parsed offline, no API key: Google Maps (/maps/place/<name>/@lat,lon,17z,
/maps/@lat,lon, the !3d!4d pin inside data= — preferred over the viewport
centre when both exist — ?q=lat,lon, ?ll=, ?z=, /maps/search/, /maps/dir/,
any google.<tld> host), Apple Maps (?ll=, ?q=, ?address=, ?sll=, ?z=),
OpenStreetMap (#map=z/lat/lon, ?mlat=&mlon= — the marker wins over the
viewport) and geo:lat,lon?z= URIs. The only network hop is a Google short
link (maps.app.goo.gl, goo.gl/maps, g.co): its redirects are followed
(at most 5, 5 s each) and the destination parsed; then "resolved_via" is
"redirect" and "final_url" is the page it landed on. Otherwise
"resolved_via" is "url". A link that names a place but carries no
coordinate (google.com/maps?q=Ferry+Building, Apple ?address=) is
resolved by name through resolve_place — "resolved_via": "name", with
the top hit's coordinate and "match": {"name", "id"}.

include_place (default true) adds "place": the reverse_geocode answer for
the coordinate (nearest address and containing admin areas), or that
call's own error dict — a place lookup failure never fails this call.
Pass false for the bare coordinate.

Errors are structured, never raised: "unsupported_url" (with the
"supported" provider list) for a link on none of these hosts,
"no_location" for a link with no usable coordinate or name (a Google
?cid= id, an OSM /node/<id> page, out-of-range coordinates, or a name
the place search cannot find — then "label" is kept), "redirect_failed"
(with "status" when HTTP said so) for a short link that would not
expand, "bad_request" for an empty or non-string url.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
include_placeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.0

TDQS

Score is being calculated.