Skip to main content
Glama

get_robot_model

Retrieve the model information for Universal Robots by providing the robot's IP address to identify and verify connected collaborative robots.

Instructions

获取指定IP的机器人型号 IP:机器人地址

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes

Implementation Reference

  • MCP tool handler for 'get_robot_model'. It sends the ur_get_robot_model command to the robot's DashboardClient, retrieves the model from the response, optionally appends 'e' based on remote control status, and returns the model.
    @mcp.tool()
    def get_robot_model(ip: str):
        """获取指定IP的机器人型号
        IP:机器人地址"""
        try:
            robot_list[ip].robotConnector.DashboardClient.ur_get_robot_model()
            model = robot_list[ip].robotConnector.DashboardClient.last_respond
            robot_list[ip].robotConnector.DashboardClient.ur_is_remote_control()
            e = robot_list[ip].robotConnector.DashboardClient.last_respond.lower()
            if e == 'true' or e == 'false':
                model = f"{model}e"
            logger.info(f"{model}e")
            return return_msg(model)
        except Exception as e:
            logger.error(f"获取机器人型号失败: {str(e)}")
            return return_msg(f"获取机器人型号失败: {str(e)}")
  • The @mcp.tool() decorator registers the get_robot_model function as an MCP tool, with input parameter 'ip: str' inferred as schema.
    @mcp.tool()
    def get_robot_model(ip: str):
        """获取指定IP的机器人型号
        IP:机器人地址"""
        try:
            robot_list[ip].robotConnector.DashboardClient.ur_get_robot_model()
            model = robot_list[ip].robotConnector.DashboardClient.last_respond
            robot_list[ip].robotConnector.DashboardClient.ur_is_remote_control()
            e = robot_list[ip].robotConnector.DashboardClient.last_respond.lower()
            if e == 'true' or e == 'false':
                model = f"{model}e"
            logger.info(f"{model}e")
            return return_msg(model)
        except Exception as e:
            logger.error(f"获取机器人型号失败: {str(e)}")
            return return_msg(f"获取机器人型号失败: {str(e)}")
  • Helper method in DashboardClient class that implements the low-level communication by sending 'get robot model' command to the UR robot's dashboard server (port 29999).
    def ur_get_robot_model(self):
        '''
        Returns the robot model
        '''
        self.__send('get robot model\n')

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