maps_around_search
Search for points of interest within a specified radius using location coordinates and keywords to find nearby businesses, landmarks, and services.
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-740 (handler)The handler function for the 'maps_around_search' tool. It performs a POI (Point of Interest) search around a given location coordinate within a specified radius, optionally filtered by keywords, using the Amap Maps API. Returns a list of nearby POIs or an error.@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)}"}
- amap_mcp_server/server.py:709-709 (registration)The @mcp.tool() decorator registers the maps_around_search function as an MCP tool, using the function name as the tool name.@mcp.tool()
- amap_mcp_server/server.py:710-710 (schema)Function signature defines the input schema: location (str, required), radius (str, default '1000'), keywords (str, default ''), returns Dict[str, Any]. Docstring provides description.def maps_around_search(location: str, radius: str = "1000", keywords: str = "") -> Dict[str, Any]: