Skip to main content
Glama
cfrs2005

GS Robot MCP Server

by cfrs2005

batch_get_robot_statuses_smart

Retrieve statuses for multiple GS cleaning robots by serial numbers, automatically grouping them by series and selecting the appropriate batch API for M-line and S-line models.

Instructions

智能批量获取机器人状态。

自动根据机器人系列分组并选择正确的批量API。
支持混合查询M-line和S-line机器人。

Args:
    serial_numbers: 机器人序列号列表
    
Returns:
    批量状态查询结果字典

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serial_numbersYes

Implementation Reference

  • Core handler implementation that groups robot serial numbers by series (M-line uses V1 API, S-line uses V2 API), fetches statuses in batches using MCP methods, adds metadata, and handles errors.
    async def batch_get_robot_statuses_smart(self, serial_numbers: List[str]) -> Dict[str, Any]:
        """智能批量获取机器人状态。
        
        自动根据机器人序列号前缀分组并选择正确的批量API。
        """
        if not serial_numbers:
            return {"results": []}
        
        # 按机器人系列分组(基于序列号前缀)
        m_line_robots = []
        s_line_robots = []
        unknown_robots = []
        
        for serial_number in serial_numbers:
            detected_series = self._determine_robot_series_from_sn(serial_number)
            
            if self.is_s_line_robot(detected_series):
                s_line_robots.append(serial_number)
            elif self.is_m_line_robot(detected_series):
                m_line_robots.append(serial_number)
            else:
                # 未知前缀默认归类为M-line (使用V1 API)
                unknown_robots.append(serial_number)
        
        results = []
        
        # 合并M-line机器人和未知机器人,都用V1 API
        v1_robots = m_line_robots + unknown_robots
        
        # 批量查询V1 API机器人状态
        if v1_robots:
            try:
                v1_results = await self.mcp.batch_get_robot_statuses_v1(v1_robots)
                if isinstance(v1_results, dict) and "results" in v1_results:
                    for result in v1_results["results"]:
                        result["api_version"] = "V1 (M-line/Default)"
                        result["detected_series"] = self._determine_robot_series_from_sn(result.get("serialNumber", ""))
                    results.extend(v1_results["results"])
                else:
                    results.extend(v1_results if isinstance(v1_results, list) else [v1_results])
            except Exception as e:
                for sn in v1_robots:
                    results.append({
                        "serialNumber": sn, 
                        "error": str(e), 
                        "robotType": "V1 API",
                        "detected_series": self._determine_robot_series_from_sn(sn)
                    })
        
        # 批量查询S-line机器人状态
        if s_line_robots:
            try:
                s_results = await self.mcp.batch_get_robot_statuses_v2(s_line_robots)
                if isinstance(s_results, dict) and "results" in s_results:
                    for result in s_results["results"]:
                        result["api_version"] = "V2 (S-line)"
                        result["detected_series"] = self._determine_robot_series_from_sn(result.get("serialNumber", ""))
                    results.extend(s_results["results"])
                else:
                    results.extend(s_results if isinstance(s_results, list) else [s_results])
            except Exception as e:
                for sn in s_line_robots:
                    results.append({
                        "serialNumber": sn, 
                        "error": str(e), 
                        "robotType": "V2 API",
                        "detected_series": self._determine_robot_series_from_sn(sn)
                    })
        
        return {
            "total": len(serial_numbers),
            "v1_count": len(v1_robots),
            "s_line_count": len(s_line_robots),
            "results": results
        }
  • MCP tool registration using @mcp.tool() decorator. This thin wrapper delegates execution to the RobotAPIRouter instance.
    @mcp.tool()
    async def batch_get_robot_statuses_smart(serial_numbers: list):
        """智能批量获取机器人状态。
        
        自动根据机器人系列分组并选择正确的批量API。
        支持混合查询M-line和S-line机器人。
        
        Args:
            serial_numbers: 机器人序列号列表
            
        Returns:
            批量状态查询结果字典
        """
        return await router.batch_get_robot_statuses_smart(serial_numbers)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool '自动根据机器人系列分组并选择正确的批量API' (automatically groups by robot series and selects the correct batch API), which adds some context about its intelligent routing behavior. However, it doesn't address critical aspects like whether this is a read-only operation, potential rate limits, authentication requirements, error handling, or what happens with invalid serial numbers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences plus parameter/return sections. The first sentence states the core purpose, the second explains the intelligent grouping feature, and the third mentions mixed query support. The structure is front-loaded with the main functionality, though the parameter section could be more detailed given the 0% schema coverage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 1 parameter with 0% schema coverage, no annotations, and no output schema, the description is incomplete. While it explains the intelligent routing behavior and mixed robot support, it lacks details on parameter constraints, return format specifics (beyond '批量状态查询结果字典' - batch status query result dictionary), error conditions, and doesn't fully address the behavioral transparency gaps for a batch operation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It provides a brief parameter description in the Args section: 'serial_numbers: 机器人序列号列表' (robot serial number list), which adds basic meaning. However, it doesn't specify format requirements (e.g., string format, length constraints), whether duplicates are allowed, minimum/maximum list size, or provide examples - leaving significant gaps in parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as '智能批量获取机器人状态' (intelligent batch retrieval of robot statuses) and specifies it works with both M-line and S-line robots. However, it doesn't explicitly differentiate from its sibling 'get_robot_status_smart' which appears to be a single-robot version, missing full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by mentioning it '自动根据机器人系列分组并选择正确的批量API' (automatically groups by robot series and selects the correct batch API) and supports mixed M-line/S-line queries, providing some guidance. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_robot_status_smart' or 'list_robots', nor does it mention any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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