Skip to main content
Glama

create_robot_command

Send commands to GS cleaning robots to control task execution, including starting, pausing, or stopping cleaning operations using robot serial numbers and command parameters.

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

  • MCP tool handler function for 'create_robot_command', decorated with @mcp.tool() for automatic registration and schema generation from type hints. Delegates execution to the GausiumMCP instance method.
    @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 )
  • Core helper method in GausiumMCP class that implements the robot command creation by calling the underlying Gausium 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 )
  • API endpoint configuration defining the path, method, version, and other details for the underlying 'create_command' endpoint used by the tool, named 'create_robot_command'.
    'create_command': APIEndpoint( name="create_robot_command", path="robots/{serial_number}/commands", method=HTTPMethod.POST, version=APIVersion.V1_ALPHA1, description="创建机器人指令" ),
  • Registration of the MCP tool via @mcp.tool() decorator on the handler function.
    @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 )

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