get_robot_model
Retrieve the model of a Universal Robot by specifying its IP address. This tool provides essential robot information for effective control and monitoring.
Instructions
获取指定IP的机器人型号 IP:机器人地址
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- The primary handler function for the 'get_robot_model' MCP tool. It uses the DashboardClient to fetch the robot model and adjusts it based on remote control status.@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" return return_msg(model) except Exception as e: logger.error(f"获取机器人型号失败: {str(e)}") return return_msg(f"获取机器人型号失败: {str(e)}")
- URBasic/dashboard.py:319-323 (helper)Helper method in DashboardClient class that sends the 'get robot model' command to the robot's dashboard server.def ur_get_robot_model(self): ''' Returns the robot model ''' self.__send('get robot model\n')
- src/nonead_universal_robots_mcp/server.py:238-252 (registration)The @mcp.tool() decorator registers this function as the MCP tool named 'get_robot_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" return return_msg(model) except Exception as e: logger.error(f"获取机器人型号失败: {str(e)}") return return_msg(f"获取机器人型号失败: {str(e)}")