get_robot_command
Retrieve the execution result of a specific command sent to a cleaning robot by providing its serial number and command ID.
Instructions
Gets the result of a specific robot command.
Args:
serial_number: The serial number of the target robot.
command_id: The ID of the command to query.
Returns:
A dictionary containing the command execution result.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial_number | Yes | ||
| command_id | Yes |
Implementation Reference
- Core handler method in GausiumMCP class that executes the get_robot_command logic. Validates inputs (serial_number, command_id), then calls the API client's call_endpoint with endpoint name 'get_command' and path parameters.
async def get_robot_command( self, serial_number: str, command_id: str ) -> Dict[str, Any]: """ 获取单条指令结果。 Args: serial_number: 机器人序列号 command_id: 指令ID Returns: 指令执行结果 Raises: ValueError: 参数为空 httpx.HTTPStatusError: API调用错误 httpx.RequestError: 网络问题 """ if not serial_number: raise ValueError("Serial number cannot be empty") if not command_id: raise ValueError("Command ID cannot be empty") async with GausiumAPIClient() as client: return await client.call_endpoint( 'get_command', path_params={ 'serial_number': serial_number, 'command_id': command_id } ) - src/gs_openapi/main.py:147-157 (registration)MCP tool registration in main.py using @mcp.tool() decorator. This is the public-facing tool function that delegates to the GausiumMCP class method.
async def get_robot_command(serial_number: str, command_id: str): """Gets the result of a specific robot command. Args: serial_number: The serial number of the target robot. command_id: The ID of the command to query. Returns: A dictionary containing the command execution result. """ return await mcp.get_robot_command(serial_number=serial_number, command_id=command_id) - API endpoint definition for get_robot_command. Defines the HTTP GET endpoint at path 'robots/{serial_number}/commands/{command_id}' under API version V1_ALPHA1.
'get_command': APIEndpoint( name="get_robot_command", path="robots/{serial_number}/commands/{command_id}", method=HTTPMethod.GET, version=APIVersion.V1_ALPHA1, description="获取单条指令结果" ),