maps_search_detail
Retrieve detailed information about specific locations using their POI ID from Amap search results. Get comprehensive data including address, contact details, and operational information for identified places.
Instructions
查询关键词搜或者周边搜获取到的POI ID的详细信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- amap_mcp_server/server.py:741-779 (handler)The handler function for the 'maps_search_detail' tool. It takes a POI ID and queries the Amap place detail API to retrieve detailed information about the point of interest, including name, location, address, etc. Handles errors appropriately.@mcp.tool() def maps_search_detail(id: str) -> Dict[str, Any]: """查询关键词搜或者周边搜获取到的POI ID的详细信息""" try: response = requests.get( "https://restapi.amap.com/v3/place/detail", params={ "key": AMAP_MAPS_API_KEY, "id": id } ) response.raise_for_status() data = response.json() if data["status"] != "1": return {"error": f"Get poi detail failed: {data.get('info') or data.get('infocode')}"} if not data.get("pois"): return {"error": "No POI found"} poi = data["pois"][0] result = { "id": poi.get("id"), "name": poi.get("name"), "location": poi.get("location"), "address": poi.get("address"), "business_area": poi.get("business_area"), "city": poi.get("cityname"), "type": poi.get("type"), "alias": poi.get("alias") } # Add biz_ext data if available if poi.get("biz_ext"): result.update(poi["biz_ext"]) return result except requests.exceptions.RequestException as e: return {"error": f"Request failed: {str(e)}"}