Skip to main content
Glama
cfrs2005

GS Robot MCP Server

by cfrs2005

create_robot_command

Send commands like start, pause, or stop tasks to a GS cleaning robot using its serial number.

Instructions

Creates a robot command.

Based on: https://developer.gs-robot.com/zh_CN/Robot%20Command%20Service/Create%20Robot%20Command

Args:
    serial_number: The serial number of the target robot.
    command_type: The type of command (e.g., 'START_TASK', 'PAUSE_TASK', 'STOP_TASK').
    command_parameter: Optional command parameters as a dictionary.

Returns:
    A dictionary containing the command creation result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serial_numberYes
command_typeYes
command_parameterNo

Implementation Reference

  • The MCP tool 'create_robot_command' is registered via the @mcp.tool() decorator. It's an async function that delegates to mcp.create_robot_command(), passing serial_number, command_type, and command_parameter.
    # Define create_robot_command tool
    @mcp.tool()
    async def create_robot_command(
        serial_number: str, 
        command_type: str,
        command_parameter: Optional[dict] = None
    ):
        """Creates a robot command.
    
        Based on: https://developer.gs-robot.com/zh_CN/Robot%20Command%20Service/Create%20Robot%20Command
    
        Args:
            serial_number: The serial number of the target robot.
            command_type: The type of command (e.g., 'START_TASK', 'PAUSE_TASK', 'STOP_TASK').
            command_parameter: Optional command parameters as a dictionary.
    
        Returns:
            A dictionary containing the command creation result.
        """
        return await mcp.create_robot_command(
            serial_number=serial_number,
            command_type=command_type,
            command_parameter=command_parameter
        )
  • The actual handler implementation of create_robot_command in the GausiumMCP class. Validates inputs, builds the request payload with serialNumber, remoteTaskCommandType, and optional commandParameter, then calls the API endpoint 'create_command' via GausiumAPIClient.
    async def create_robot_command(
        self,
        serial_number: str,
        command_type: str,
        command_parameter: Optional[Dict[str, Any]] = None
    ) -> Dict[str, Any]:
        """
        创建机器人指令。
    
        Args:
            serial_number: 机器人序列号
            command_type: 指令类型 (如 'START_TASK', 'PAUSE_TASK', 等)
            command_parameter: 指令参数
    
        Returns:
            指令创建结果
    
        Raises:
            ValueError: 参数无效
            httpx.HTTPStatusError: API调用错误
            httpx.RequestError: 网络问题
        """
        if not serial_number:
            raise ValueError("Serial number cannot be empty")
        if not command_type:
            raise ValueError("Command type cannot be empty")
    
        request_data = {
            "serialNumber": serial_number,
            "remoteTaskCommandType": command_type
        }
        
        if command_parameter:
            request_data["commandParameter"] = command_parameter
    
        async with GausiumAPIClient() as client:
            return await client.call_endpoint(
                'create_command',
                path_params={'serial_number': serial_number},
                json_data=request_data
            )
  • The endpoint definition for 'create_command' used by the handler. Defines the API path as 'v1alpha1/robots/{serial_number}/commands' with POST method, mapping to the 'create_robot_command' API service.
    # 机器人指令服务端点  
    ROBOT_COMMAND_ENDPOINTS = {
        'create_command': APIEndpoint(
            name="create_robot_command",
            path="robots/{serial_number}/commands",
            method=HTTPMethod.POST,
            version=APIVersion.V1_ALPHA1,
            description="创建机器人指令"
        ),
        'get_command': APIEndpoint(
            name="get_robot_command",
            path="robots/{serial_number}/commands/{command_id}",
            method=HTTPMethod.GET,
            version=APIVersion.V1_ALPHA1,
            description="获取单条指令结果"
        ),
        'list_commands': APIEndpoint(
            name="list_robot_commands",
            path="robots/{serial_number}/commands",
            method=HTTPMethod.GET,
            version=APIVersion.V1_ALPHA1,
            description="获取机器人历史发出指令"
        )
    }
Behavior2/5

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

The description lacks disclosure of behavioral traits such as whether the command is asynchronous, failure modes, or required permissions. The annotation field is empty, so the description carries full burden but only states 'Creates a robot command' without depth. The URL reference is external and not directly actionable.

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 concise at ~8 lines, with a clear structure: purpose, reference, args list, returns. It front-loads the purpose and includes only essential details. The URL adds slight noise but is brief.

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?

With no annotations or output schema, the description must cover all context. It specifies inputs and return type but omits command_type options, error handling, and permissions. It is adequate for a basic understanding but not fully complete for safe invocation.

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?

Schema descriptions are absent (0% coverage), so the description compensates by explaining each parameter: serial_number as robot identifier, command_type as type of command, and command_parameter as optional dictionary. This adds meaning beyond the schema's titles, especially for command_parameter.

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?

Description states 'Creates a robot command' clearly. It includes a reference URL and lists parameters, making the purpose explicit. However, it does not explicitly differentiate from sibling tools like submit_temp_site_task or execute_m_line_task_workflow, which also create robot actions, leaving some ambiguity.

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 on when to use this tool versus alternatives. The description only defines what the tool does without context for selection. Sibling tools exist for executing tasks and submitting jobs, but no criteria are given for choosing create_robot_command over them.

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