Skip to main content
Glama
cfrs2005

GS Robot MCP Server

by cfrs2005

execute_s_line_no_site_task_workflow

Automates S-line robot task execution by listing maps, selecting one, retrieving subareas, building a task, and submitting it, using robot serial number and task parameters without site information.

Instructions

Executes complete S-line robot task workflow without site information.

Automated process: Map list → Map selection → Subarea retrieval → Task building → Task submission

Args:
    robot_sn: The serial number of the target robot.
    task_parameters: Task parameters including map criteria and task settings.

Returns:
    A dictionary containing the workflow execution result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
robot_snYes
task_parametersYes

Implementation Reference

  • MCP tool registration for 'execute_s_line_no_site_task_workflow'. The @mcp.tool() decorator registers this function as an MCP tool. It accepts robot_sn (serial number) and task_parameters (dict), then delegates to mcp.execute_s_line_no_site_task_workflow().
    @mcp.tool()
    async def execute_s_line_no_site_task_workflow(
        robot_sn: str,
        task_parameters: dict
    ):
        """Executes complete S-line robot task workflow without site information.
        
        Automated process: Map list → Map selection → Subarea retrieval → Task building → Task submission
    
        Args:
            robot_sn: The serial number of the target robot.
            task_parameters: Task parameters including map criteria and task settings.
    
        Returns:
            A dictionary containing the workflow execution result.
        """
        return await mcp.execute_s_line_no_site_task_workflow(
            robot_sn=robot_sn,
            task_parameters=task_parameters
        )
  • Handler method in GausiumMCP class. This async method delegates to the task_engine.execute_s_line_no_site_task() method, passing robot_sn and task_parameters.
    async def execute_s_line_no_site_task_workflow(
        self,
        robot_sn: str,
        task_parameters: Dict[str, Any]
    ) -> Dict[str, Any]:
        """
        执行S线无站点任务完整工作流。
        
        自动化流程:地图列表 → 地图选择 → 分区获取 → 任务构建 → 任务下发
        
        Args:
            robot_sn: 机器人序列号
            task_parameters: 任务参数
            
        Returns:
            工作流执行结果
        """
        return await self.task_engine.execute_s_line_no_site_task(
            robot_sn=robot_sn,
            task_parameters=task_parameters
        )
  • Core implementation of the S-line no-site task workflow. The execute_s_line_no_site_task() method: 1) Gets robot map list via API, 2) Selects target map, 3) Gets map subareas, 4) Builds task data, 5) Submits temporary no-site task via API.
    async def execute_s_line_no_site_task(
        self,
        robot_sn: str,
        task_parameters: Dict[str, Any]
    ) -> Dict[str, Any]:
        """
        执行S线无站点任务。
        
        工作流:
        1. 获取机器人地图列表
        2. 获取目标地图分区
        3. 构建并下发无站点临时任务
        
        Args:
            robot_sn: 机器人序列号
            task_parameters: 任务参数
            
        Returns:
            任务执行结果
        """
        logger.info(f"Starting S-line no-site task execution for robot: {robot_sn}")
        
        async with GausiumAPIClient() as client:
            try:
                # 1. 获取机器人地图列表
                maps_response = await client.call_endpoint(
                    'list_maps',
                    json_data={'robotSn': robot_sn}
                )
                
                # 处理Gausium特殊响应格式
                if maps_response.get('code') != 0:
                    raise RuntimeError(f"Failed to get maps: {maps_response.get('msg')}")
                
                available_maps = maps_response.get('data', [])
                if not available_maps:
                    raise ValueError("No maps found for robot")
                
                # 2. 选择目标地图
                target_map_id = self._select_map_from_list(
                    available_maps,
                    task_parameters.get('map_criteria', {})
                )
                
                # 3. 获取地图分区
                subareas = await client.call_endpoint(
                    'get_map_subareas',
                    path_params={'map_id': target_map_id}
                )
                
                # 4. 构建任务数据
                task_data = self._build_no_site_task_data(
                    target_map_id,
                    subareas,
                    task_parameters
                )
                
                # 5. 下发无站点临时任务
                task_result = await client.call_endpoint(
                    'submit_temp_no_site_task',
                    json_data=task_data
                )
                
                logger.info(f"S-line no-site task executed successfully: {task_result}")
                return task_result
                
            except Exception as e:
                logger.error(f"S-line no-site task execution failed: {str(e)}")
                raise
  • Helper method _select_map_from_list() - selects target map from available maps based on criteria.
    def _select_map_from_list(
        self,
        available_maps: List[Dict[str, Any]],
        criteria: Dict[str, Any]
    ) -> str:
        """
        从地图列表中选择目标地图。
        
        Args:
            available_maps: 可用地图列表  
            criteria: 选择条件
            
        Returns:
            选中的地图ID
        """
        if not criteria:
            return available_maps[0]['mapId']
        
        # TODO: 实现地图选择逻辑
        for map_info in available_maps:
            if self._matches_criteria(map_info, criteria):
                return map_info['mapId']
        
        return available_maps[0]['mapId']
  • Helper method _build_no_site_task_data() - builds task data payload for no-site task submission.
    def _build_no_site_task_data(
        self,
        map_id: str,
        subareas: Dict[str, Any],
        task_parameters: Dict[str, Any]
    ) -> Dict[str, Any]:
        """
        构建无站点任务数据。
        
        Args:
            map_id: 地图ID
            subareas: 地图分区信息
            task_parameters: 任务参数
            
        Returns:
            任务数据
        """
        # TODO: 根据实际API要求构建任务数据
        task_data = {
            "mapId": map_id,
            "subareas": subareas,
            "taskType": task_parameters.get('task_type', 'cleaning'),
            "cleaningMode": task_parameters.get('cleaning_mode', '__middle_cleaning'),
            **task_parameters
        }
        
        return task_data
Behavior2/5

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

No annotations are provided. The description lists automation steps (Map list → Task submission) but does not disclose side effects, permissions needed, error handling, or whether the task submission is destructive. With no annotations, the description should provide more behavioral detail.

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 moderately concise, organized with steps, Args, and Returns. It could omit the step list without losing core meaning, but it remains efficient and scannable.

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 no output schema and complex workflow, the description lacks details on result contents, error states, and prerequisite knowledge. It does not fully equip the agent to understand what the workflow produces or how parameters affect behavior.

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?

Schema coverage is 0%. For 'robot_sn', the description adds little beyond the schema title. For 'task_parameters', it vaguely mentions 'map criteria and task settings' but fails to specify the expected object structure or keys, leaving the agent underinformed.

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

Purpose5/5

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

The description clearly states it executes a complete S-line robot task workflow without site information, distinguishing it from the sibling tool 'execute_s_line_site_task_workflow'. The steps list further clarifies the scope.

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

Usage Guidelines4/5

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

The description implies use when site information is absent via 'without site information', but it does not explicitly contrast with the site-aware sibling or mention when-not to use. Context is clear, but exclusion guidance is missing.

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