maps_search_detail
Retrieve detailed information about specific locations using their POI ID from search results, providing comprehensive place details for navigation and planning purposes.
Instructions
查询关键词搜或者周边搜获取到的POI ID的详细信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"id": {
"title": "Id",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- amap_mcp_server/server.py:741-779 (handler)The handler function for the 'maps_search_detail' tool. It fetches detailed information for a POI by its ID from the Amap API. The @mcp.tool() decorator registers it with the MCP server.@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)}"}