Skip to content

FindNearestMosques

Zubir Jamal edited this page Jul 4, 2026 · 4 revisions

🧭 Tool: find_nearest_mosques

Finds verified masjids and suraus within a given radius of a location, sorted by distance, with ready-to-use navigation deep links for Google Maps and Waze.


Parameters

Parameter Type Required Description
location_name string Optional* Plain-text location, e.g. "Kajang, Selangor"
latitude number Optional* GPS latitude coordinate
longitude number Optional* GPS longitude coordinate
distance_km integer Optional Search radius in kilometres. Defaults to 5.

*Provide either location_name or a latitude/longitude pair.


Response

Returns a list of mosque objects sorted by distance (nearest first).

Fields Per Mosque

Field Type Description
name string Official mosque or surau name
distance_km number Distance from the query location (km)
coordinates object { latitude, longitude } of the mosque
google_maps_link string Direct Google Maps URL
waze_link string Direct Waze deep link with auto-navigate enabled

Example Response

[
  {
    "name": "MASJID JAMEK PEKAN KAJANG",
    "distance_km": 0.21,
    "coordinates": { "latitude": 2.997541, "longitude": 101.788168 },
    "google_maps_link": "https://maps.google.com/?q=2.997541,101.788168",
    "waze_link": "https://waze.com/ul?ll=2.997541,101.788168&navigate=yes&z=10"
  },
  {
    "name": "MASJID HJ. MAT SAMAN",
    "distance_km": 1.89,
    "coordinates": { "latitude": 2.984102, "longitude": 101.796345 },
    "google_maps_link": "https://maps.google.com/?q=2.984102,101.796345",
    "waze_link": "https://waze.com/ul?ll=2.984102,101.796345&navigate=yes&z=10"
  }
]

Notes

  • Results include both **masjids ** and **surau **.
  • Waze links use navigate=yes — tapping the link will immediately start turn-by-turn navigation.
  • For real-time location queries (e.g. "near me"), pass GPS coordinates directly for the most accurate results.

Example Queries

"Find the nearest surau to KLCC." "Which mosque is closest to KLIA right now?" "I'm at Mid Valley, find me a masjid within 3km." "Where's the nearest mosque in Putrajaya?"


Related Tools


Error Handling

All errors are returned as a structured JSON object with a single error field.

Error Schema

{ "error": "<human-readable message>" }

Error Reference

Scenario Error Message
No location provided "Provide either a location_name string or latitude/longitude coordinates."
Location name cannot be resolved "Location '<name>' could not be resolved. Try a different name or use coordinates."
OpenStreetMap geocoding unreachable "Location lookup failed: could not reach or parse OpenStreetMap data. Try again later."
General network failure "Network error while searching for mosques. Please try again later."

Clone this wiki locally