Skip to main content
Glama
cfrs2005

GS Robot MCP Server

by cfrs2005

get_task_reports_smart

Retrieve task reports for GS cleaning robots by automatically selecting the appropriate API based on robot series, with filtering by time range and pagination.

Instructions

智能获取任务报告。

自动根据机器人系列选择M-line或S-line任务报告API。

Args:
    serial_number: 机器人序列号
    page: 页码
    page_size: 每页大小
    start_time_utc_floor: 开始时间过滤
    start_time_utc_upper: 结束时间过滤
    
Returns:
    任务报告数据字典

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serial_numberYes
pageNo
page_sizeNo
start_time_utc_floorNo
start_time_utc_upperNo

Implementation Reference

  • Core handler function that implements the smart routing logic for task reports: detects robot series from serial_number prefix and calls the appropriate MCP method (list_robot_task_reports_s for S-line or list_robot_task_reports for M-line/default). Adds metadata like api_version and detected_series.
    async def get_task_reports_smart(self, serial_number: str, **kwargs) -> Dict[str, Any]:
        """智能获取任务报告。
        
        自动根据机器人序列号前缀选择M-line或S-line任务报告API。
        """
        # 基于序列号前缀判断机器人系列
        detected_series = self._determine_robot_series_from_sn(serial_number)
        
        if self.is_s_line_robot(detected_series):
            # S-line 机器人使用专用任务报告API
            result = await self.mcp.list_robot_task_reports_s(serial_number, **kwargs)
            result["api_version"] = "S-line API"
            result["detected_series"] = detected_series
            return result
        else:
            # M-line 机器人或未知类型使用默认任务报告API
            result = await self.mcp.list_robot_task_reports(serial_number, **kwargs)
            result["api_version"] = "M-line/Default API"
            result["detected_series"] = detected_series
            return result
  • MCP tool registration using @mcp.tool() decorator. Defines input schema via parameters and docstring. Acts as a thin wrapper that prepares kwargs and delegates to the router's handler.
    @mcp.tool()
    async def get_task_reports_smart(serial_number: str, page: int = 1, page_size: int = 10, 
                                    start_time_utc_floor: str = None, start_time_utc_upper: str = None):
        """智能获取任务报告。
        
        自动根据机器人系列选择M-line或S-line任务报告API。
        
        Args:
            serial_number: 机器人序列号
            page: 页码
            page_size: 每页大小
            start_time_utc_floor: 开始时间过滤
            start_time_utc_upper: 结束时间过滤
            
        Returns:
            任务报告数据字典
        """
        kwargs = {"page": page, "page_size": page_size}
        if start_time_utc_floor:
            kwargs["start_time_utc_floor"] = start_time_utc_floor
        if start_time_utc_upper:
            kwargs["start_time_utc_upper"] = start_time_utc_upper
        
        return await router.get_task_reports_smart(serial_number, **kwargs)
  • Helper method that determines the robot series (e.g., '40', '50', '75', 'S', 'SW') from the serial number prefix using the ROBOT_SERIES_MAPPING. Critical for smart routing decisions.
    def _determine_robot_series_from_sn(self, serial_number: str) -> str:
        """根据序列号前缀判断机器人系列。
        
        Args:
            serial_number: 机器人序列号
            
        Returns:
            机器人系列代码 (40, 50, 75, S, SW) 或 "unknown"
        """
        if len(serial_number) < 5:
            return "unknown"
        
        prefix = serial_number[:5]
        return self.ROBOT_SERIES_MAPPING.get(prefix, "unknown")
  • Static mapping dictionary of robot serial number prefixes to series codes, used by _determine_robot_series_from_sn to classify robots for API routing.
    ROBOT_SERIES_MAPPING = {
        # M-line 机器人
        "GS100": "75",    # 75系列
        "GS400": "75",    # 75系列 (新发现)
        "GS500": "75",    # 75系列
        "GS301": "50",    # 50系列
        "GS401": "50",    # 50系列  
        "GS501": "50",    # 50系列 (新发现)
        "GS442": "40",    # 40系列
        
        # S-line 机器人
        "GS438": "S",     # S系列
        "GS408": "S",     # S系列
        "GS43C": "SW",    # SW系列
    }
  • Helper method to check if a robot series code corresponds to S-line robots (uses V2/S-specific APIs).
    def is_s_line_robot(self, model_family_code: str) -> bool:
        """判断是否为S-line机器人。"""
        return model_family_code in ["S", "SW"]
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. While it mentions '智能获取' (intelligent acquisition) and automatic API selection, it doesn't describe important behavioral aspects like whether this is a read-only operation, what permissions are required, rate limits, pagination behavior beyond basic parameters, or what happens with invalid inputs. The description provides minimal behavioral context for a tool with 5 parameters.

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 efficiently structured with a clear purpose statement followed by Args and Returns sections. Each sentence serves a purpose, though the Chinese-to-English parameter naming could be more consistent. The structure is front-loaded with the core functionality.

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

Completeness3/5

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

For a tool with 5 parameters, no annotations, and no output schema, the description provides basic parameter semantics and return format indication ('任务报告数据字典' - task report data dictionary). However, it lacks details about error conditions, authentication requirements, rate limits, and the structure of returned data. The description is minimally adequate but has clear gaps given the tool's complexity.

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

Parameters4/5

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

The description lists all 5 parameters with Chinese names and brief explanations, adding significant value beyond the schema which has 0% description coverage. It clarifies that 'serial_number' is the robot serial number, 'page' and 'page_size' control pagination, and the time parameters filter by start time range. This compensates well for the schema's lack of descriptions.

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: '智能获取任务报告' (intelligently get task reports) and specifies it automatically selects between M-line or S-line APIs based on robot series. This is a specific verb+resource combination, though it doesn't explicitly differentiate from sibling tools like 'generate_task_report_png' or 'execute_m_line_task_workflow'.

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 automatic API selection based on robot series, but doesn't provide explicit guidance on when to use this tool versus alternatives like 'generate_task_report_png' or the various task execution workflows. It offers some contextual information but lacks clear when/when-not directives.

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