maps_around_search
Search for nearby points of interest using keywords and coordinates within a specified radius on Gaode Maps.
Instructions
周边搜,根据用户传入关键词以及坐标location,搜索出radius半径范围的POI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | ||
| radius | No | 1000 | |
| keywords | No |
Implementation Reference
- amap_mcp_server/server.py:709-739 (handler)The handler function decorated with @mcp.tool(), implementing the maps_around_search tool by querying the Amap place/around API for POIs near a location within a specified radius and keywords.@mcp.tool() def maps_around_search(location: str, radius: str = "1000", keywords: str = "") -> Dict[str, Any]: """周边搜,根据用户传入关键词以及坐标location,搜索出radius半径范围的POI""" try: response = requests.get( "https://restapi.amap.com/v3/place/around", params={ "key": AMAP_MAPS_API_KEY, "location": location, "radius": radius, "keywords": keywords } ) response.raise_for_status() data = response.json() if data["status"] != "1": return {"error": f"Around Search failed: {data.get('info') or data.get('infocode')}"} pois = [] for poi in data.get("pois", []): pois.append({ "id": poi.get("id"), "name": poi.get("name"), "address": poi.get("address"), "typecode": poi.get("typecode") }) return {"pois": pois} except requests.exceptions.RequestException as e: return {"error": f"Request failed: {str(e)}"}