get_safety_mode
Retrieve the safety mode status of a specified robot using its IP address for monitoring and control in the nUR MCP Server environment.
Instructions
获取指定IP机器人的安全模式 IP:机器人地址
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- The @mcp.tool()-decorated handler function that implements the get_safety_mode tool. It checks the robot connection, calls ur_safetymode() on the DashboardClient, and returns the safety mode.@mcp.tool() def get_safety_mode(ip: str): """获取指定IP机器人的安全模式 IP:机器人地址""" try: if '连接失败' in link_check(ip): return return_msg(f"与机器人的连接已断开。") robot_list[ip].robotConnector.DashboardClient.ur_safetymode() result = robot_list[ip].robotConnector.DashboardClient.last_respond return return_msg(f"IP为{ip}的优傲机器人的安全模式是{result}") except Exception as e: logger.error(f"安全模式获取失败: {str(e)}") return return_msg(f"安全模式获取失败: {str(e)}")
- Docstring describing the tool's purpose and input parameter 'ip: str' (robot IP address). Serves as input schema documentation."""获取指定IP机器人的安全模式 IP:机器人地址"""
- src/nonead_universal_robots_mcp/server.py:255-255 (registration)The @mcp.tool() decorator registers this function as an MCP tool.@mcp.tool()