Skip to main content
Glama

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

NameRequiredDescriptionDefault
idYes

Input Schema (JSON Schema)

{ "properties": { "id": { "title": "Id", "type": "string" } }, "required": [ "id" ], "type": "object" }

Implementation Reference

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

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