send_program_script
Send program scripts to Universal Robots collaborative robots at specified IP addresses to control motion, execute tasks, and monitor operations through direct commands.
Instructions
发送脚本到指定IP的机器人。 IP:机器人地址 script:脚本内容
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes | ||
| script | Yes |
Implementation Reference
- The handler function for the 'send_program_script' tool. It sends a script program to the Universal Robot at the given IP address using the RealTimeClient.SendProgram method, after checking the connection.@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) time.sleep(1) logger.info(f"发送脚本:{script}") return return_msg(f"脚本程序已发送,请确认执行结果。") except Exception as e: logger.error(f"发送脚本失败: {str(e)}") return return_msg(f"发送脚本失败: {str(e)}")
- src/nonead_universal_robots_mcp/server.py:534-534 (registration)The @mcp.tool() decorator registers the send_program_script function as an MCP tool.@mcp.tool()