disconnect_ur
Disconnect from a Universal Robots collaborative robot by providing its IP address to terminate the active connection.
Instructions
根据用户提供的IP,断开与UR机器人的连接 IP:机器人地址
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- The implementation of the 'disconnect_ur' tool. This function is decorated with @mcp.tool(), registering it as an MCP tool. It disconnects the UR robot at the specified IP by calling robot_list[ip].close() if the connection exists, handling errors appropriately.@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() logger.info(f"连接已断开。IP:{ip}") return return_msg("连接已断开。") except Exception as e: logger.error(f"连接断开失败: {str(e)}") return return_msg(f"连接断开失败: {str(e)}")