Skip to main content
Glama

suggest_meeting_point

Calculate a central meeting point for multiple people from different locations and recommend nearby venues like cafes or parks. Ideal for planning gatherings or meetings.

Instructions

Find the optimal meeting place for multiple people coming from different locations.

This tool calculates a central meeting point based on the locations of multiple individuals, then recommends suitable venues near that central point. Ideal for planning social gatherings, business meetings, or any situation where multiple people need to converge from different starting points.

Args: locations: List of dictionaries, each containing the latitude and longitude of a person's location Example: [{"latitude": 37.7749, "longitude": -122.4194}, {"latitude": 37.3352, "longitude": -121.8811}] venue_type: Type of venue to suggest as a meeting point. Options include: "cafe", "restaurant", "bar", "library", "park", etc.

Returns: Meeting point recommendations including: - Calculated center point coordinates - List of suggested venues with names and details - Total number of matching venues in the area

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationsYes
venue_typeNocafe

Implementation Reference

  • The core handler function for the 'suggest_meeting_point' tool. It calculates the average (centroid) of multiple input locations, searches for nearby venues of the specified type (default 'cafe') using OSM data via get_nearby_pois, filters them, and returns the top suggestions with the center point.
    @mcp.tool() async def suggest_meeting_point( locations: List[Dict[str, float]], ctx: Context, venue_type: str = "cafe" ) -> Dict[str, Any]: """ Find the optimal meeting place for multiple people coming from different locations. This tool calculates a central meeting point based on the locations of multiple individuals, then recommends suitable venues near that central point. Ideal for planning social gatherings, business meetings, or any situation where multiple people need to converge from different starting points. Args: locations: List of dictionaries, each containing the latitude and longitude of a person's location Example: [{"latitude": 37.7749, "longitude": -122.4194}, {"latitude": 37.3352, "longitude": -121.8811}] venue_type: Type of venue to suggest as a meeting point. Options include: "cafe", "restaurant", "bar", "library", "park", etc. Returns: Meeting point recommendations including: - Calculated center point coordinates - List of suggested venues with names and details - Total number of matching venues in the area """ osm_client = ctx.request_context.lifespan_context.osm_client if len(locations) < 2: raise ValueError("Need at least two locations to suggest a meeting point") # Calculate the center point (simple average) avg_lat = sum(loc.get("latitude", 0) for loc in locations) / len(locations) avg_lon = sum(loc.get("longitude", 0) for loc in locations) / len(locations) ctx.info(f"Calculating center point for {len(locations)} locations: ({avg_lat}, {avg_lon})") # Search for venues around this center point venues = await osm_client.get_nearby_pois( avg_lat, avg_lon, radius=500, # Search within 500m of center categories=["amenity"] ) # Filter venues by type matching_venues = [] for venue in venues: tags = venue.get("tags", {}) if tags.get("amenity") == venue_type: matching_venues.append({ "id": venue.get("id"), "name": tags.get("name", "Unnamed Venue"), "latitude": venue.get("lat"), "longitude": venue.get("lon"), "tags": tags }) # If no venues found, expand search if not matching_venues: ctx.info(f"No {venue_type} found within 500m, expanding search to 1000m") venues = await osm_client.get_nearby_pois( avg_lat, avg_lon, radius=1000, categories=["amenity"] ) for venue in venues: tags = venue.get("tags", {}) if tags.get("amenity") == venue_type: matching_venues.append({ "id": venue.get("id"), "name": tags.get("name", "Unnamed Venue"), "latitude": venue.get("lat"), "longitude": venue.get("lon"), "tags": tags }) # Return the result return { "center_point": { "latitude": avg_lat, "longitude": avg_lon }, "suggested_venues": matching_venues[:5], # Top 5 venues "venue_type": venue_type, "total_options": len(matching_venues) }
  • Supporting method in OSMClient class used by suggest_meeting_point to fetch nearby points of interest via Overpass API query.
    async def get_nearby_pois(self, lat: float, lon: float, radius: float = 1000, categories: List[str] = None) -> List[Dict]: """Get points of interest near a location""" if not self.session: raise RuntimeError("OSM client not connected") # Convert radius to bounding box (approximate) # 1 degree latitude ~= 111km # 1 degree longitude ~= 111km * cos(latitude) lat_delta = radius / 111000 lon_delta = radius / (111000 * math.cos(math.radians(lat))) bbox = ( lon - lon_delta, lat - lat_delta, lon + lon_delta, lat + lat_delta ) # Build Overpass query overpass_url = "https://overpass-api.de/api/interpreter" # Default to common POI types if none specified if not categories: categories = ["amenity", "shop", "tourism", "leisure"] # Build tag filters tag_filters = [] for category in categories: tag_filters.append(f'node["{category}"]({{bbox}});') query = f""" [out:json]; ( {" ".join(tag_filters)} ); out body; """ query = query.replace("{bbox}", f"{bbox[1]},{bbox[0]},{bbox[3]},{bbox[2]}") async with self.session.post(overpass_url, data={"data": query}) as response: if response.status == 200: data = await response.json() return data.get("elements", []) else: raise Exception(f"Failed to get nearby POIs: {response.status}")
  • The @mcp.tool() decorator registers the suggest_meeting_point function as an MCP tool.
    @mcp.tool()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jagan-shanmugam/open-streetmap-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server