get_robot_model
Retrieve the model information for Universal Robots by providing the robot's IP address to identify and verify connected collaborative robots.
Instructions
获取指定IP的机器人型号 IP:机器人地址
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- MCP tool handler for 'get_robot_model'. It sends the ur_get_robot_model command to the robot's DashboardClient, retrieves the model from the response, optionally appends 'e' based on remote control status, and returns the model.@mcp.tool() def get_robot_model(ip: str): """获取指定IP的机器人型号 IP:机器人地址""" try: robot_list[ip].robotConnector.DashboardClient.ur_get_robot_model() model = robot_list[ip].robotConnector.DashboardClient.last_respond robot_list[ip].robotConnector.DashboardClient.ur_is_remote_control() e = robot_list[ip].robotConnector.DashboardClient.last_respond.lower() if e == 'true' or e == 'false': model = f"{model}e" logger.info(f"{model}e") return return_msg(model) except Exception as e: logger.error(f"获取机器人型号失败: {str(e)}") return return_msg(f"获取机器人型号失败: {str(e)}")
- src/nonead_universal_robots_mcp/server.py:276-291 (registration)The @mcp.tool() decorator registers the get_robot_model function as an MCP tool, with input parameter 'ip: str' inferred as schema.@mcp.tool() def get_robot_model(ip: str): """获取指定IP的机器人型号 IP:机器人地址""" try: robot_list[ip].robotConnector.DashboardClient.ur_get_robot_model() model = robot_list[ip].robotConnector.DashboardClient.last_respond robot_list[ip].robotConnector.DashboardClient.ur_is_remote_control() e = robot_list[ip].robotConnector.DashboardClient.last_respond.lower() if e == 'true' or e == 'false': model = f"{model}e" logger.info(f"{model}e") return return_msg(model) except Exception as e: logger.error(f"获取机器人型号失败: {str(e)}") return return_msg(f"获取机器人型号失败: {str(e)}")
- URBasic/dashboard.py:319-324 (helper)Helper method in DashboardClient class that implements the low-level communication by sending 'get robot model' command to the UR robot's dashboard server (port 29999).def ur_get_robot_model(self): ''' Returns the robot model ''' self.__send('get robot model\n')