Skip to main content
Glama
nonead

nUR MCP Server

by nonead

movej

Control robot joint movements by sending precise angle, speed, acceleration, and timing parameters to Universal Robots through the nUR MCP Server.

Instructions

发送新的关节姿态到指定IP的机器人,使每个关节都旋转至指定弧度。 IP:机器人地址, q:各关节角度, a:加速度(米每平方秒), v:速度(米每秒), t:移动时长(秒), r:交融半径(米)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes
qYes
aNo
vNo
tNo
rNo

Implementation Reference

  • The MCP tool handler for 'movej'. Decorated with @mcp.tool(), it handles the tool execution by linking to the robot, sending the movej command via the UR library, and confirming success using movejConfirm.
    @mcp.tool()
    def movej(ip: str, q: list, a=1, v=1, t=0, r=0):
        """发送新的关节姿态到指定IP的机器人,使每个关节都旋转至指定弧度。
        IP:机器人地址,
        q:各关节角度,
        a:加速度(米每平方秒),
        v:速度(米每秒),
        t:移动时长(秒),
        r:交融半径(米)。"""
        try:
            if '连接失败' in link_check(ip):
                return return_msg(f"与机器人的连接已断开。")
    
            cmd = f"movej({q},{a},{v},{t},{r})"
            logger.info(f"发送脚本:{cmd}")
            robot_list[ip].movej(q, a, v, t, r)
            time.sleep(1)
            result = movejConfirm(ip, q)
    
            if result == 1:
                return return_msg(f"命令 {cmd} 已发送,移动完成。")
            else:
                return return_msg(f"命令 {cmd} 已发送,移动失败。")
        except Exception as e:
            logger.error(f"发送新的关节姿态到UR机器人失败: {str(e)}")
            return return_msg(f"发送新的关节姿态到UR机器人: {str(e)}")
  • Helper function used by movej to confirm if the robot has reached the target joint positions and program has stopped.
    def movejConfirm(ip, q):
        """
        movej移动的结果确认
        1:移动到位
        2:移动结束,但是位置不准确
        """
        loop_flg = True
        count = 0
        while loop_flg:
            time.sleep(1)
            current_pose = round_pose(robot_list[ip].get_actual_joint_positions())
            if right_pose_joint(current_pose, q):
                robot_list[ip].robotConnector.DashboardClient.ur_running()
                running = robot_list[ip].robotConnector.DashboardClient.last_respond
                if running == 'Program running: false':
                    return 1
            else:
                robot_list[ip].robotConnector.DashboardClient.ur_running()
                running = robot_list[ip].robotConnector.DashboardClient.last_respond
    
                if running == 'Program running: true':
                    # 尚未移动完成
                    continue
                else:
                    # 移动完成
                    count = count + 1
                    if count > 5:
                        return 2
  • Helper to round poses for comparison in movejConfirm.
    def round_pose(pose):
        """给坐标取近似值,精确到三位小数"""
        pose[0] = round(pose[0], 3)
        pose[1] = round(pose[1], 3)
        pose[2] = round(pose[2], 3)
        pose[3] = round(pose[3], 3)
        pose[4] = round(pose[4], 3)
        pose[5] = round(pose[5], 3)
        return pose
  • Helper to check if current joint pose matches target within tolerance for movejConfirm.
    def right_pose_joint(current_pose, q):
        """关节的弧度验证,允许0.1的误差,按角度计算大约5度"""
        if q[0] + 0.1 >= current_pose[0] >= q[0] - 0.1:
            if q[1] + 0.1 >= current_pose[1] >= q[1] - 0.1:
                if q[2] + 0.1 >= current_pose[2] >= q[2] - 0.1:
                    if q[3] + 0.1 >= current_pose[3] >= q[3] - 0.1:
                        if q[4] + 0.1 >= current_pose[4] >= q[4] - 0.1:
                            if q[5] + 0.1 >= current_pose[5] >= q[5] - 0.1:
                                return True
        return False
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions sending commands to a robot which implies a write/mutation operation, but doesn't address safety considerations, error conditions, confirmation of execution, or what happens if the robot is in an invalid state. For a tool that controls physical robot movement, this is a significant safety and operational gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by parameter explanations. Each sentence serves a purpose, though the parameter explanations could be more precisely formatted. The Chinese text is direct without unnecessary elaboration, though some technical terms lack complete clarity for non-specialists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that controls physical robot movement with 6 parameters (2 required), no annotations, and no output schema, the description is insufficient. It doesn't address critical context like safety requirements, error handling, confirmation mechanisms, or what constitutes successful execution. The absence of output schema means the description should explain what the tool returns, but it doesn't.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides Chinese parameter explanations that add meaning beyond the schema's 0% coverage. It clarifies 'q' as joint angles, 'a' as acceleration (m/s²), 'v' as velocity (m/s), 't' as movement duration (seconds), and 'r' as blend radius (meters). However, it doesn't specify units for 'q' (radians implied but not stated), ranges, or constraints for any parameters, leaving important semantic gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool sends new joint poses to a robot at a specified IP address to rotate each joint to specified radians. It specifies the verb ('发送' - send), resource (robot at IP), and action (rotate joints to radians). However, it doesn't explicitly differentiate from sibling tools like 'movel', 'movel_x', etc., which likely perform different types of robot movements.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple movement-related sibling tools (movel, movel_x, movel_y, movel_z), there's no indication of when joint-based movement (movej) is preferred over other movement types. No prerequisites, exclusions, or alternative recommendations are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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