get_robot_command
Retrieve execution results for specific robot commands by providing the robot's serial number and command ID to monitor task completion and status.
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
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial_number | Yes | ||
| command_id | Yes |
Implementation Reference
- Core handler implementation in GausiumMCP class that performs the actual API call to retrieve the robot command result using GausiumAPIClient.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:146-157 (registration)MCP tool registration using @mcp.tool() decorator. This is the entry point handler for the 'get_robot_command' tool, delegating to the core MCP implementation.@mcp.tool() 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)
- Data-driven API endpoint schema/configuration for 'get_robot_command', defining path, method, version, used by GausiumAPIClient to construct HTTP requests.'get_command': APIEndpoint( name="get_robot_command", path="robots/{serial_number}/commands/{command_id}", method=HTTPMethod.GET, version=APIVersion.V1_ALPHA1, description="获取单条指令结果" ),