get_actual_tcp_pose
Retrieve the current TCP position of a Universal Robots collaborative robot by specifying its IP address to monitor robot status and control motion.
Instructions
获取指定IP机器人的当前TCP位置 IP:机器人地址
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- The primary handler function for the MCP tool 'get_actual_tcp_pose'. It is decorated with @mcp.tool(), which also serves as registration. The function takes an IP address, checks the robot connection via link_check, retrieves the actual TCP pose from the UR robot instance, logs it, and returns a formatted message. This is the exact implementation of the tool logic.@mcp.tool() def get_actual_tcp_pose(ip: str): """获取指定IP机器人的当前TCP位置 IP:机器人地址""" try: if '连接失败' in link_check(ip): return return_msg(f"与机器人的连接已断开。") logger.info(f"当前TCP位置: {robot_list[ip].get_actual_tcp_pose()}") return return_msg(f"当前TCP位置: {robot_list[ip].get_actual_tcp_pose()}") except Exception as e: logger.error(f"TCP位置获取失败: {str(e)}") return return_msg(f"TCP位置获取失败: {str(e)}")