Skip to main content
Glama
nonead

Nonead Universal-Robots MCP Server

by nonead

draw_circle

Command a Universal Robot to draw a circle by specifying center position, radius, and plane orientation. The robot executes the circular motion precisely.

Instructions

命令指定IP的机器人,给定圆心位置和半径,在水平或竖直方向画一个圆 center:圆心的TCP位置 r:半径(米) coordinate:圆所在的平面。z:圆形所在的平面与基座所在平面垂直,其它:圆形所在的平面与基座所在平面平行。默认值:z。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes
centerYes
rYes
coordinateNoz

Implementation Reference

  • The 'draw_circle' tool handler function. It is registered via @mcp.tool() decorator on line 685. It receives an IP, center position, radius, and coordinate plane, then generates URScript move commands (movep + movec) to draw a circle. The circle is drawn either in the Z-plane (vertical, relative to base) or another plane (horizontal). It sends the generated program to the robot via RealTimeClient.SendProgram.
    @mcp.tool()
    def draw_circle(ip: str, center: list, r: float, coordinate="z"):
        """命令指定IP的机器人,给定圆心位置和半径,在水平或竖直方向画一个圆
            center:圆心的TCP位置
            r:半径(米)
            coordinate:圆所在的平面。z:圆形所在的平面与基座所在平面垂直,其它:圆形所在的平面与基座所在平面平行。默认值:z。"""
        try:
            if '连接失败' in link_check(ip):
                return return_msg(f"与机器人的连接已断开。")
            wp_1 = [center[0], center[1], center[2], center[3], center[4], center[5]]
            wp_2 = [center[0], center[1], center[2], center[3], center[4], center[5]]
            wp_3 = [center[0], center[1], center[2], center[3], center[4], center[5]]
            wp_4 = [center[0], center[1], center[2], center[3], center[4], center[5]]
            cmd = ''
            if coordinate.lower() == "z":
                wp_1[2] = wp_1[2] + r
    
                wp_2[1] = wp_2[1] + r
    
                wp_3[2] = wp_3[2] - r
    
                wp_4[1] = wp_4[1] - r
            else:
                wp_1[0] = wp_1[0] - r
    
                wp_2[1] = wp_2[1] + r
    
                wp_3[0] = wp_3[0] + r
    
                wp_4[1] = wp_4[1] - r
    
            cmd = (
                f"def my_program():\n"
                f"  movep(p{str(wp_1)}, a=1, v=0.25, r=0.025)\n"
                f"  movec(p{str(wp_2)}, p{str(wp_3)}, a=1, v=0.25, r=0.025, mode=0)\n"
                f"  movec(p{str(wp_4)}, p{str(wp_1)}, a=1, v=0.25, r=0.025, mode=0)\nend\nmy_program()")
            logger.info(f"draw_circle 发送脚本:{cmd}")
            robot_list[ip].robotConnector.RealTimeClient.SendProgram(cmd)
            time.sleep(1)
            return return_msg(f"命令已发送:{cmd}")
        except Exception as e:
            logger.error(f"命令发送失败: {str(e)}")
            return return_msg(f"命令发送失败: {str(e)}")
  • Registration of 'draw_circle' as an MCP tool using the @mcp.tool() decorator, which is applied to the draw_circle function defined on line 686.
    @mcp.tool()
    def draw_circle(ip: str, center: list, r: float, coordinate="z"):
  • Helper function return_msg used by draw_circle to format the JSON response string.
    def return_msg(txt: str):
        return json.dumps(txt, indent=2, ensure_ascii=False)
  • Helper function link_check used by draw_circle to verify the robot connection before sending commands.
    def link_check(ip):
        """检查连接状态,若连接断开或不存在,则建立连接"""
        if robot_list.get(ip, "unknown") == "unknown" or not robot_list[
            ip].robotConnector.RTDE.isRunning():
            return connect_ur(ip)
        return '连接成功'
  • The FastMCP server instance (mcp) that provides the @mcp.tool() decorator used to register draw_circle.
    mcp = FastMCP(
        "nUR_MCP_SERVER",
        description="Control UR robots through the Model Context Protocol"
    )
Behavior2/5

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

Without annotations, the description carries the full burden. It explains the coordinate plane behavior but does not disclose safety concerns, required permissions, or side effects (e.g., robot movement, collision risks). The behavioral traits are only partially covered.

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 concise, consisting of a single sentence and parameter explanations. It front-loads the primary action and scopes the parameters. However, the structure is somewhat informal and could be more organized.

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

Completeness3/5

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

Given the absence of annotations and output schema, the description covers the core functionality and parameter semantics but lacks details on return values, error handling, prerequisites (e.g., robot connection), and integration with sibling tools. It is minimally viable but not fully comprehensive.

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?

With 0% schema description coverage, the description adds meaning for center (TCP position), r (radius in meters), and coordinate (plane orientation with defaults). However, the 'ip' parameter is only mentioned as 'specified IP' without format details, and 'center' lacks element type specification, leaving 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 'draws a circle' with specified center and radius, and clarifies the plane orientation via the coordinate parameter. It distinguishes the tool from sibling drawing tools like draw_rectangle and draw_square by focusing on circular motion, though it does not explicitly compare them.

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

Usage Guidelines3/5

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

The description implies usage when a circular path is needed, but provides no explicit guidance on when to choose this tool over alternatives (e.g., draw_rectangle, movel). There are no prerequisites, conditional logic, or exclusions stated.

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/Nonead-Universal-Robots-MCP'

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