disconnect_ur
Terminate a UR robot's connection by specifying its IP address using the nUR MCP Server. Ensures controlled disconnection for industrial robotics management.
Instructions
根据用户提供的IP,断开与UR机器人的连接 IP:机器人地址
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- The main handler function for the 'disconnect_ur' tool. It is decorated with @mcp.tool(), which registers it as an MCP tool. The function takes an IP string, checks if the connection exists in robot_list, closes the connection if it does, and returns appropriate messages.@mcp.tool() def disconnect_ur(ip: str): """根据用户提供的IP,断开与UR机器人的连接 IP:机器人地址""" try: if robot_list.get(ip, "unknown") == "unknown": return return_msg("连接不存在") robot_list[ip].close() return return_msg("连接已断开。") except Exception as e: logger.error(f"连接断开失败: {str(e)}") return return_msg(f"连接断开失败: {str(e)}")
- src/nonead_universal_robots_mcp/server.py:180-180 (registration)The @mcp.tool() decorator registers the disconnect_ur function as an MCP tool.@mcp.tool()
- The docstring describes the input parameter 'ip' as the robot's IP address, serving as input schema documentation."""根据用户提供的IP,断开与UR机器人的连接 IP:机器人地址"""
- Internal call to disconnect_ur within the connection logic.disconnect_ur(ip)