send_program_script
Send programmed scripts to Universal Robots via IP address using the nUR MCP Server. Input robot IP and script content to execute specific tasks directly.
Instructions
发送脚本到指定IP的机器人。 IP:机器人地址 script:脚本内容
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes | ||
| script | Yes |
Implementation Reference
- The core handler implementation for the MCP tool 'send_program_script'. It is registered via the @mcp.tool() decorator. The function checks the robot connection, sends the script using URBasic's RealTimeClient.SendProgram, and returns a JSON-formatted success or error message.@mcp.tool() def send_program_script(ip: str, script: str): """发送脚本到指定IP的机器人。 IP:机器人地址 script:脚本内容""" try: if '连接失败' in link_check(ip): return return_msg(f"与机器人的连接已断开。") robot_list[ip].robotConnector.RealTimeClient.SendProgram(script) return return_msg(f"脚本程序已发送,请确认执行结果。") except Exception as e: logger.error(f"发送脚本失败: {str(e)}") return return_msg(f"发送脚本失败: {str(e)}")