Skip to main content
Glama
cfrs2005

GS Robot MCP Server

by cfrs2005

execute_m_line_task_workflow

Executes automated robot task workflows by querying status, selecting tasks, and running commands for GS cleaning robots.

Instructions

Executes complete M-line robot task workflow.

Automated process: Status query → Task selection → Command execution

Args:
    serial_number: The serial number of the target robot.
    task_selection_criteria: Optional task selection criteria.

Returns:
    A dictionary containing the workflow execution result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serial_numberYes
task_selection_criteriaNo

Implementation Reference

  • MCP tool registration with @mcp.tool() decorator. Thin wrapper that delegates to GausiumMCP instance method.
    @mcp.tool()
    async def execute_m_line_task_workflow(
        serial_number: str,
        task_selection_criteria: Optional[dict] = None
    ):
        """Executes complete M-line robot task workflow.
        
        Automated process: Status query → Task selection → Command execution
    
        Args:
            serial_number: The serial number of the target robot.
            task_selection_criteria: Optional task selection criteria.
    
        Returns:
            A dictionary containing the workflow execution result.
        """
        return await mcp.execute_m_line_task_workflow(
            serial_number=serial_number,
            task_selection_criteria=task_selection_criteria
        )
  • Core handler logic: fetches robot status, extracts and selects available tasks, issues START_TASK command via API client.
    async def execute_m_line_task(
        self,
        serial_number: str,
        task_selection_criteria: Optional[Dict[str, Any]] = None
    ) -> Dict[str, Any]:
        """
        执行M线机器人任务。
        
        工作流:
        1. 获取机器人状态
        2. 从状态中提取可执行任务列表
        3. 根据条件选择任务
        4. 通过Create Robot Command下发任务
        
        Args:
            serial_number: 机器人序列号
            task_selection_criteria: 任务选择条件
            
        Returns:
            任务执行结果
        """
        logger.info(f"Starting M-line task execution for robot: {serial_number}")
        
        async with GausiumAPIClient() as client:
            try:
                # 1. 获取机器人状态
                status = await client.call_endpoint(
                    'get_robot_status_v1',
                    path_params={'serial_number': serial_number}
                )
                
                # 2. 解析可执行任务列表
                available_tasks = self._extract_m_line_tasks(status)
                if not available_tasks:
                    raise ValueError("No executable tasks found in robot status")
                
                # 3. 选择任务
                selected_task = self._select_m_line_task(
                    available_tasks, 
                    task_selection_criteria or {}
                )
                
                # 4. 构建并下发任务指令
                command_result = await client.call_endpoint(
                    'create_command',
                    path_params={'serial_number': serial_number},
                    json_data={
                        "serialNumber": serial_number,
                        "remoteTaskCommandType": "START_TASK",
                        "commandParameter": {
                            "startTaskParameter": selected_task
                        }
                    }
                )
                
                logger.info(f"M-line task executed successfully: {command_result}")
                return command_result
                
            except Exception as e:
                logger.error(f"M-line task execution failed: {str(e)}")
                raise
  • GausiumMCP class method that delegates workflow execution to the task_engine instance.
    async def execute_m_line_task_workflow(
        self,
        serial_number: str,
        task_selection_criteria: Optional[Dict[str, Any]] = None
    ) -> Dict[str, Any]:
        """
        执行M线机器人完整任务工作流。
        
        自动化流程:状态查询 → 任务选择 → 指令下发
        
        Args:
            serial_number: 机器人序列号
            task_selection_criteria: 任务选择条件
            
        Returns:
            工作流执行结果
        """
        return await self.task_engine.execute_m_line_task(
            serial_number=serial_number,
            task_selection_criteria=task_selection_criteria
        )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the workflow steps but doesn't describe important behavioral aspects: whether this is a read-only or mutating operation, what permissions are required, whether it's idempotent, what happens on failure, or any rate limits. The description provides minimal behavioral context beyond the basic workflow steps.

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 clear structure: purpose statement, workflow steps, parameter explanations, and return value description. Each sentence serves a purpose. However, the parameter explanations could be more efficiently integrated with the purpose statement rather than in a separate 'Args:' section.

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?

For a workflow execution tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is insufficient. It doesn't explain what the workflow actually does (beyond listing steps), what constitutes a successful result, error conditions, or how the optional task_selection_criteria influences the workflow. The return value description is vague ('dictionary containing workflow execution result').

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

Parameters3/5

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

With 0% schema description coverage, the description must compensate but only partially succeeds. It explains that serial_number identifies the target robot and task_selection_criteria is optional, but doesn't clarify what format or content the criteria should have (the schema shows it can be any object or null). The description adds some meaning but doesn't fully compensate for the complete lack of schema 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: executing a complete M-line robot task workflow with specific steps (status query → task selection → command execution). It distinguishes from siblings by specifying 'M-line' workflow, differentiating from S-line and other robot-related tools. However, it doesn't explicitly contrast with all siblings like batch_get_robot_statuses_smart or create_robot_command.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, when this automated workflow is appropriate versus manual steps, or how it relates to sibling tools like execute_s_line_no_site_task_workflow or submit_temp_no_site_task. The agent must infer usage from the name and description alone.

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