get_actual_robot_voltage
Retrieve the current voltage in volts for a Universal Robots collaborative robot by specifying its IP address. This tool enables monitoring of robot power status through the nUR MCP Server's industrial control interface.
Instructions
获取指定IP机器人的电压(伏特) IP:机器人地址
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- The tool handler for 'get_actual_robot_voltage'. Decorated with @mcp.tool() for registration in FastMCP. Checks robot connection via link_check, then retrieves voltage using robotModle_list[ip].ActualRobotVoltage() from URBasic, logs and returns the value in JSON format.
@mcp.tool() def get_actual_robot_voltage(ip: str): """获取指定IP机器人的电压(伏特) IP:机器人地址""" try: if '连接失败' in link_check(ip): return return_msg(f"与机器人的连接已断开。") logger.info(f"{robotModle_list[ip].ActualRobotVoltage()}(伏特)") return return_msg(f"{robotModle_list[ip].ActualRobotVoltage()}(伏特)") except Exception as e: logger.error(f"机器人的电压获取失败: {str(e)}") return return_msg(f"机器人的电压获取失败: {str(e)}") - src/nonead_universal_robots_mcp/server.py:432-432 (registration)The @mcp.tool() decorator registers the get_actual_robot_voltage function as an MCP tool.
@mcp.tool()