Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • 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)}"}

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/sugarforever/amap-mcp-server'

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