Skip to main content
Glama
cfrs2005

GS Robot MCP Server

by cfrs2005

get_map_subareas

Retrieve detailed subarea information from robot maps to enable precise zone control and targeted cleaning operations.

Instructions

Gets map subareas information for precise area control.

Args:
    map_id: The ID of the target map.

Returns:
    A dictionary containing map subareas information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
map_idYes

Implementation Reference

  • Core handler method in GausiumMCP class that implements the tool logic by calling the Gausium API client with appropriate endpoint.
    async def get_map_subareas(self, map_id: str, robot_sn: str = None) -> Dict[str, Any]:
        """
        获取地图分区信息。
    
        Args:
            map_id: 地图ID
            robot_sn: 机器人序列号 (某些API版本需要)
    
        Returns:
            地图分区详细信息
    
        Raises:
            ValueError: map_id为空
            httpx.HTTPStatusError: API调用错误
            httpx.RequestError: 网络问题
        """
        if not map_id:
            raise ValueError("Map ID cannot be empty")
    
        # 构建请求体
        request_data = {"mapId": map_id}
        if robot_sn:
            request_data["robotSn"] = robot_sn
    
        async with GausiumAPIClient() as client:
            return await client.call_endpoint(
                'get_map_subareas',
                json_data=request_data
            )
  • MCP tool registration using @mcp.tool() decorator. Thin wrapper that delegates to the GausiumMCP instance method.
    @mcp.tool()
    async def get_map_subareas(map_id: str):
        """Gets map subareas information for precise area control.
    
        Args:
            map_id: The ID of the target map.
    
        Returns:
            A dictionary containing map subareas information.
        """
        return await mcp.get_map_subareas(map_id=map_id)
  • API endpoint configuration defining the path, method, version, and other details used by the GausiumAPIClient to make the actual HTTP call.
    'get_map_subareas': APIEndpoint(
        name="get_map_subareas",
        path="map/subareas/get",
        method=HTTPMethod.POST,
        version=APIVersion.OPENAPI_V1,
        description="查询机器人地图分区"
    ),

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/cfrs2005/mcp-gs-robot'

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