Skip to main content
Glama
nonead

nUR MCP Server

by nonead

draw_square

Draw a square in horizontal or vertical planes by specifying start position and side length. Use this tool to create geometric shapes with industrial robots through coordinate-based commands.

Instructions

给定起点位置和边长,在水平或竖直方向画一个正方形 origin:画正方形时TCP的起点位置 border:边长(米) coordinate:圆所在的平面。z:圆形所在的平面与基座所在平面垂直,其它:圆形所在的平面与基座所在平面平行。默认值:z。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes
originYes
borderYes
coordinateNoz

Implementation Reference

  • The draw_square tool handler. Decorated with @mcp.tool() for registration in MCP. Calculates waypoints for a square shape based on origin, border length, and coordinate plane, then sends a URScript program to the robot to execute linear movements forming the square.
    @mcp.tool()
    def draw_square(ip: str, origin: list, border: float, coordinate="z"):
        """给定起点位置和边长,在水平或竖直方向画一个正方形
            origin:画正方形时TCP的起点位置
            border:边长(米)
            coordinate:圆所在的平面。z:圆形所在的平面与基座所在平面垂直,其它:圆形所在的平面与基座所在平面平行。默认值:z。
            """
        try:
            if '连接失败' in link_check(ip):
                return return_msg(f"与机器人的连接已断开。")
            wp_1 = [origin[0], origin[1], origin[2], origin[3], origin[4], origin[5]]
            wp_2 = [origin[0], origin[1], origin[2], origin[3], origin[4], origin[5]]
            wp_3 = [origin[0], origin[1], origin[2], origin[3], origin[4], origin[5]]
            if coordinate.lower() == "z":
                wp_1[1] = wp_1[1] + border
    
                wp_2[1] = wp_2[1] + border
                wp_2[2] = wp_2[2] - border
    
                wp_3[2] = wp_3[2] - border
    
            else:
                wp_1[1] = wp_1[1] + border
    
                wp_2[1] = wp_2[1] + border
                wp_2[0] = wp_2[0] + border
    
                wp_3[0] = wp_3[0] + border
    
            cmd = (f"def my_program():\n"
                   f"  movel(p{str(origin)}, a=1, v=0.25)\n"
                   f"  movel(p{str(wp_1)}, a=1, v=0.25)\n"
                   f"  movel(p{str(wp_2)}, a=1, v=0.25)\n"
                   f"  movel(p{str(wp_3)}, a=1, v=0.25)\n"
                   f"  movel(p{str(origin)}, a=1, v=0.25)\nend\nmy_program()")
            logger.info(f"draw_square 发送脚本:\n{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)}")
  • MCP tool registration decorator for draw_square function.
    @mcp.tool()
  • Tool schema and description in docstring, including parameter descriptions and type hints: ip: str, origin: list, border: float, coordinate: str (default 'z').
    """给定起点位置和边长,在水平或竖直方向画一个正方形
        origin:画正方形时TCP的起点位置
        border:边长(米)
        coordinate:圆所在的平面。z:圆形所在的平面与基座所在平面垂直,其它:圆形所在的平面与基座所在平面平行。默认值:z。
        """
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 the action ('画' - draw) which implies a write/mutation operation, but doesn't describe safety considerations, permission requirements, side effects, or what happens upon execution. For a robotic control tool with potential physical consequences, this is a significant 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 reasonably concise with a clear purpose statement followed by parameter explanations. Each sentence adds value, though the coordinate explanation could be more clearly structured. No redundant information is present.

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 robotic drawing tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'TCP' refers to (Tool Center Point), doesn't clarify the coordinate system, doesn't describe error conditions or success indicators, and leaves the 'ip' parameter unexplained. Given the potential safety implications of robotic control, more context is needed.

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?

Schema description coverage is 0%, so the description must compensate. It provides some semantic meaning for origin ('画正方形时TCP的起点位置' - TCP starting position when drawing square), border ('边长(米)' - side length in meters), and coordinate (explains orientation planes). However, it doesn't explain the 'ip' parameter at all, leaving one of four parameters completely undocumented.

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's purpose: '在水平或竖直方向画一个正方形' (draw a square in horizontal or vertical direction). It specifies the verb ('画' - draw) and resource ('正方形' - square), though it doesn't explicitly differentiate from sibling tools like draw_circle or draw_rectangle beyond the shape name.

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?

No guidance is provided about when to use this tool versus alternatives like draw_rectangle or draw_circle. The description mentions the tool's function but doesn't indicate specific scenarios, prerequisites, or exclusions for its use.

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