Skip to main content
Glama
nonead

nUR MCP Server

by nonead

setup_multi_robot_coordination

Configure multiple industrial robots to work together by specifying robot IDs and collaboration modes like sequential, parallel, synchronous, or hierarchical.

Instructions

设置多机器人协同工作环境

参数:
- robot_ids: 参与协同的机器人ID列表
- collaboration_mode: 协作模式,可选值包括"sequential", "parallel", "synchronous", "hierarchical"

返回:
- 成功或失败的消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
robot_idsYes
collaboration_modeNoparallel

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the setup_multi_robot_coordination tool. It initializes multi-robot coordination by registering connected robots and setting the collaboration mode using the AdvancedMultiRobotCoordinator instance.
    def setup_multi_robot_coordination(robot_ids: list, collaboration_mode: str = "parallel"):
        """
        设置多机器人协同工作环境
        
        参数:
        - robot_ids: 参与协同的机器人ID列表
        - collaboration_mode: 协作模式,可选值包括"sequential", "parallel", "synchronous", "hierarchical"
        
        返回:
        - 成功或失败的消息
        """
        try:
            if multi_robot_coordinator is None:
                return return_msg("多机器人协调器未初始化")
            
            # 映射协作模式字符串到枚举值
            mode_map = {
                "sequential": CollaborationMode.SEQUENTIAL,
                "parallel": CollaborationMode.PARALLEL,
                "synchronous": CollaborationMode.SYNCHRONOUS,
                "hierarchical": CollaborationMode.HIERARCHICAL
            }
            
            if collaboration_mode not in mode_map:
                return return_msg(f"不支持的协作模式: {collaboration_mode}")
            
            # 注册机器人到协调器
            for robot_id in robot_ids:
                # 检查机器人是否已连接
                if robot_id in robot_list and robot_list[robot_id].robotConnector.RTDE.isRunning():
                    multi_robot_coordinator.register_robot(robot_id)
                    logger.info(f"机器人 {robot_id} 已注册到协调器")
                else:
                    return return_msg(f"机器人 {robot_id} 未连接或不可用")
            
            # 设置协作模式
            multi_robot_coordinator.set_collaboration_mode(mode_map[collaboration_mode])
            
            return return_msg(f"多机器人协同环境设置成功,协作模式: {collaboration_mode}")
        except Exception as e:
            logger.error(f"设置多机器人协同环境失败: {str(e)}")
            return return_msg(f"设置多机器人协同环境失败: {str(e)}")
  • The @mcp.tool() decorator registers the function as an MCP tool.
    def setup_multi_robot_coordination(robot_ids: list, collaboration_mode: str = "parallel"):
  • Initializes the global multi_robot_coordinator instance used by the tool, along with other modules.
    def initialize_extended_modules():
        """初始化所有扩展模块"""
        global multi_robot_coordinator, advanced_trajectory_planner
        global advanced_data_recorder, advanced_data_analyzer
    
        try:
            # 初始化多机器人协调器
            multi_robot_coordinator = AdvancedMultiRobotCoordinator()
            logger.info("高级多机器人协调器初始化成功")
    
            # 初始化高级轨迹规划器
            advanced_trajectory_planner = AdvancedTrajectoryPlanner()
            logger.info("高级轨迹规划器初始化成功")
    
            # 初始化高级数据记录器
            advanced_data_recorder = AdvancedDataRecorder()
            logger.info("高级数据记录器初始化成功")
    
            # 获取数据分析器实例(单例)
            advanced_data_analyzer = get_data_analyzer()
            logger.info("高级数据分析器初始化成功")
    
            return True
        except Exception as e:
            logger.error(f"初始化扩展模块失败: {str(e)}")
            return False
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool '设置多机器人协同工作环境' (sets up multi-robot coordination environment) and returns success/failure messages, but lacks critical details: whether this is a read-only or mutating operation, what permissions are required, if it has side effects (e.g., configuring network settings), rate limits, or error conditions. For a setup tool with zero annotation coverage, 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 appropriately sized and front-loaded: the first line states the purpose, followed by clear sections for parameters and returns. Each sentence earns its place by adding value, with no redundant information. However, the structure could be slightly improved by integrating the parameter explanations more seamlessly rather than as a separate list.

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 tool's complexity (setup operation with 2 parameters, no annotations, no output schema), the description is minimally adequate. It covers the purpose and parameters well but lacks behavioral context (e.g., mutability, side effects) and output details beyond success/failure messages. For a setup tool that likely involves system configuration, more completeness is needed to guide safe usage.

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

Parameters4/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 adds meaningful semantics: 'robot_ids' is explained as a list of robot IDs participating in coordination, and 'collaboration_mode' is described with four specific enum values ('sequential', 'parallel', 'synchronous', 'hierarchical') and a default of 'parallel' implied in the schema. This provides clear context beyond the bare schema, though it doesn't detail format constraints (e.g., ID structure).

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 as '设置多机器人协同工作环境' (set up multi-robot coordination environment), which is a specific verb+resource combination. It distinguishes itself from siblings like 'create_collaborative_task' or 'execute_collaborative_task' by focusing on environment setup rather than task creation or execution. However, it doesn't explicitly contrast with all potential alternatives among the many sibling tools.

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. It doesn't mention prerequisites (e.g., robots must be connected), exclusions, or comparisons to sibling tools like 'create_collaborative_task' or 'execute_collaborative_task'. The agent must infer usage context solely from the tool name and description.

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