Skip to main content
Glama
nonead

nUR MCP Server

by nonead

compare_robots_performance

Analyze and compare performance metrics across multiple industrial robots within specified timeframes to identify operational differences.

Instructions

比较多个机器人的性能

参数:
- robot_ids: 机器人ID列表
- metric_columns: 比较指标列
- start_time: 开始时间戳
- end_time: 结束时间戳

返回:
- 比较结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
robot_idsYes
metric_columnsYes
start_timeNo
end_timeNo

Implementation Reference

  • The MCP tool handler decorated with @mcp.tool(). It checks if the advanced_data_analyzer is initialized and calls its compare_robots method with the provided parameters, wrapping the result in return_msg.
    @mcp.tool()
    def compare_robots_performance(robot_ids: list, metric_columns: list, start_time: float = None, end_time: float = None):
        """
        比较多个机器人的性能
        
        参数:
        - robot_ids: 机器人ID列表
        - metric_columns: 比较指标列
        - start_time: 开始时间戳
        - end_time: 结束时间戳
        
        返回:
        - 比较结果
        """
        try:
            if advanced_data_analyzer is None:
                return return_msg("高级数据分析器未初始化")
            
            # 执行比较
            comparison = advanced_data_analyzer.compare_robots(
                robot_ids=robot_ids,
                metric_columns=metric_columns,
                start_time=start_time,
                end_time=end_time
            )
            
            return return_msg({"comparison": comparison})
        except Exception as e:
            logger.error(f"比较机器人性能失败: {str(e)}")
            return return_msg(f"比较机器人性能失败: {str(e)}")
  • The core helper method in AdvancedDataAnalyzer class that performs the robot comparison by loading data for each robot ID, computing mean, median, std, min, max for each metric column, and generating a summary with best robot per metric.
    def compare_robots(self, 
                      robot_ids: List[str],
                      start_time: Optional[float] = None,
                      end_time: Optional[float] = None,
                      metric_columns: Optional[List[str]] = None) -> Dict[str, Any]:
        """
        比较多个机器人的性能
        
        Args:
            robot_ids: 机器人ID列表
            start_time: 开始时间
            end_time: 结束时间
            metric_columns: 要比较的指标列
            
        Returns:
            Dict[str, Any]: 比较结果
        """
        comparison_results = {
            'robots': {},
            'summary': {}
        }
        
        all_data = []
        
        # 收集每个机器人的数据
        for robot_id in robot_ids:
            df = self.load_data(
                start_time=start_time,
                end_time=end_time,
                robot_id=robot_id
            )
            
            if not df.empty:
                comparison_results['robots'][robot_id] = {
                    'data_points': len(df),
                    'metrics': {}
                }
                
                # 计算指标
                if metric_columns:
                    for col in metric_columns:
                        if col in df.columns:
                            comparison_results['robots'][robot_id]['metrics'][col] = {
                                'mean': df[col].mean(),
                                'median': df[col].median(),
                                'std': df[col].std(),
                                'min': df[col].min(),
                                'max': df[col].max()
                            }
                
                all_data.append((robot_id, df))
        
        # 生成比较摘要
        if metric_columns and all_data:
            for col in metric_columns:
                values = []
                valid_robots = []
                
                for robot_id, df in all_data:
                    if col in df.columns:
                        values.append(df[col].mean())
                        valid_robots.append(robot_id)
                
                if values:
                    best_idx = np.argmin(values) if 'error' in col.lower() or 'temperature' in col.lower() else np.argmax(values)
                    comparison_results['summary'][col] = {
                        'best_robot': valid_robots[best_idx],
                        'best_value': values[best_idx],
                        'average_value': np.mean(values),
                        'range': {'min': min(values), 'max': max(values)},
                        'variation': np.std(values) / np.mean(values) if np.mean(values) > 0 else 0
                    }
        
        return comparison_results
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states what the tool does at a high level ('比较多个机器人的性能') and lists parameters/return values. It doesn't disclose important behavioral traits like whether this is a read-only operation, if it requires specific permissions, how it handles errors, rate limits, or what format the comparison results take. For a tool with 4 parameters and no annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise with clear sections (purpose, parameters, return). However, it's somewhat under-specified rather than optimally concise - the purpose statement is vague, and parameter explanations are minimal. The structure with bullet points is helpful, but the content within each section lacks depth.

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?

Given 4 parameters with 0% schema coverage, no annotations, no output schema, and multiple sibling tools, the description is incomplete. It doesn't explain what 'performance' means in this context, what metrics are comparable, how results are structured, or how this differs from related tools. For a comparison tool in what appears to be a robotics system, more context is needed for effective use.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description lists parameter names but adds minimal semantic value: it translates 'robot_ids' to '机器人ID列表' (robot ID list) and 'metric_columns' to '比较指标列' (comparison metric columns), but doesn't explain what valid values are, what metrics are available, or what time format to use. For 4 parameters with zero schema coverage, the description doesn't adequately compensate.

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: '比较多个机器人的性能' (compare multiple robots' performance). It specifies the verb (compare) and resource (robots' performance), making the intent unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'analyze_robot_data' or 'generate_robot_report', which might have overlapping functionality.

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. With sibling tools like 'analyze_robot_data' and 'generate_robot_report' available, there's no indication of what distinguishes this comparison tool from those analysis/reporting tools. No prerequisites, exclusions, or context for usage are mentioned.

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