list_robot_maps
Retrieve available maps for a specific GS cleaning robot using its serial number to access navigation and operational areas.
Instructions
Fetches the list of maps associated with a specific robot.
Based on: https://developer.gs-robot.com/zh_CN/Robot%20Map%20Service/V1%20List%20Robot%20Map
Note: This API uses POST method with robotSn in the JSON body.
Args:
robot_sn: The serial number of the target robot (e.g., 'GS008-0180-C7P-0000').
Returns:
A list of dictionaries, each containing 'mapId' and 'mapName'.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| robot_sn | Yes |
Implementation Reference
- src/gs_openapi/main.py:50-63 (handler)MCP tool handler: the @mcp.tool()-decorated function that executes the list_robot_maps tool logic by delegating to the GausiumMCP instance.@mcp.tool() async def list_robot_maps(robot_sn: str): """Fetches the list of maps associated with a specific robot. Based on: https://developer.gs-robot.com/zh_CN/Robot%20Map%20Service/V1%20List%20Robot%20Map Note: This API uses POST method with robotSn in the JSON body. Args: robot_sn: The serial number of the target robot (e.g., 'GS008-0180-C7P-0000'). Returns: A list of dictionaries, each containing 'mapId' and 'mapName'. """ return await mcp.list_robot_maps(robot_sn=robot_sn)
- Core helper method in GausiumMCP class that implements the API call to retrieve the list of robot maps via GausiumAPIClient.async def list_robot_maps(self, robot_sn: str) -> List[Dict[str, Any]]: """ 获取与特定机器人关联的地图列表。 Args: robot_sn: 目标机器人的序列号 Returns: 包含地图ID和地图名称的字典列表 Raises: ValueError: 如果robot_sn为空 httpx.HTTPStatusError: API调用返回错误状态码 httpx.RequestError: 网络连接问题 KeyError: 响应格式异常 """ if not robot_sn: raise ValueError("Robot serial number cannot be empty") async with GausiumAPIClient() as client: response = await client.call_endpoint( 'list_maps', json_data={'robotSn': robot_sn} ) # 处理Gausium特殊的响应格式 if response.get('code') == 0: return response.get('data', []) else: raise RuntimeError(f"API returned error: {response.get('msg', 'Unknown error')}")
- Schema/endpoint configuration defining the HTTP details (path, method, version) for the list_robot_maps API call.'list_maps': APIEndpoint( name="list_robot_maps", path="map/robotMap/list", method=HTTPMethod.POST, version=APIVersion.OPENAPI_V1, description="V1列出机器人地图" ),