Skip to main content
Glama

get_actual_tcp_pose

Retrieve the current TCP position of a Universal Robots collaborative robot by specifying its IP address to monitor or control its precise location.

Instructions

获取指定IP机器人的当前TCP位置 IP:机器人地址

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes

Implementation Reference

  • The primary MCP tool handler for 'get_actual_tcp_pose'. It takes an IP address, checks the connection, and retrieves the current TCP pose from the connected UR robot instance (UrScriptExt), logging and returning the pose as a formatted message.
    @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)}")
  • The @mcp.tool() decorator registers this function as an MCP tool in the FastMCP server. All such decorated functions are automatically registered when mcp.run() is called in main().
    @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)}")
  • Input schema defined by function signature (ip: str) and docstring describing the parameter as the robot's IP address. Output is a JSON string via return_msg containing the TCP pose.
    def get_actual_tcp_pose(ip: str): """获取指定IP机器人的当前TCP位置 IP:机器人地址"""
  • Supporting method in UrScriptExt that prints the actual TCP pose by calling the underlying get_actual_tcp_pose() method (likely inherited), which is delegated to by the MCP handler.
    self.print_pose(self.get_actual_tcp_pose())

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nonead/nUR-MCP-SERVER'

If you have feedback or need assistance with the MCP directory API, please join our Discord server