Skip to main content
Glama
nonead

nUR MCP Server

by nonead

analyze_robot_data

Analyze robot operational data to identify statistical patterns, trends, anomalies, and performance metrics for Universal Robots collaborative robots.

Instructions

分析机器人数据

参数:
- robot_id: 机器人ID
- analysis_type: 分析类型,可选值包括"statistical", "trend", "anomaly", "performance"
- start_time: 开始时间戳
- end_time: 结束时间戳

返回:
- 分析结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
robot_idYes
analysis_typeYes
start_timeNo
end_timeNo

Implementation Reference

  • The handler function for the analyze_robot_data tool. Decorated with @mcp.tool() which registers it with the FastMCP server. Implements the core logic by loading robot data and performing analysis (statistical, trend, anomaly, performance) using the advanced_data_analyzer module.
    @mcp.tool()
    def analyze_robot_data(robot_id: str, analysis_type: str, start_time: float = None, end_time: float = None):
        """
        分析机器人数据
        
        参数:
        - robot_id: 机器人ID
        - analysis_type: 分析类型,可选值包括"statistical", "trend", "anomaly", "performance"
        - start_time: 开始时间戳
        - end_time: 结束时间戳
        
        返回:
        - 分析结果
        """
        try:
            if advanced_data_analyzer is None:
                return return_msg("高级数据分析器未初始化")
            
            # 映射分析类型字符串到枚举值
            type_map = {
                "statistical": AnalysisType.STATISTICAL,
                "trend": AnalysisType.TREND,
                "anomaly": AnalysisType.ANOMALY,
                "performance": AnalysisType.PERFORMANCE
            }
            
            if analysis_type not in type_map:
                return return_msg(f"不支持的分析类型: {analysis_type}")
            
            # 加载数据
            df = advanced_data_analyzer.load_data(
                robot_id=robot_id,
                start_time=start_time,
                end_time=end_time
            )
            
            if df.empty:
                return return_msg({"error": "未找到数据"})
            
            # 执行分析
            analysis_params = {}
            if analysis_type == "trend" and 'timestamp' in df.columns:
                # 对于趋势分析,使用时间戳作为x轴
                numeric_columns = df.select_dtypes(include=['float64', 'int64']).columns.tolist()
                if numeric_columns and numeric_columns[0] != 'timestamp':
                    analysis_params = {'x_column': 'timestamp', 'y_column': numeric_columns[0]}
            
            result = advanced_data_analyzer.analyze(
                df,
                type_map[analysis_type],
                analysis_params
            )
            
            return return_msg({"analysis_type": analysis_type, "result": result})
        except Exception as e:
            logger.error(f"分析机器人数据失败: {str(e)}")
            return return_msg(f"分析机器人数据失败: {str(e)}")
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. While it mentions parameters and a return value, it doesn't describe important behavioral aspects like whether this is a read-only operation, computational cost, execution time, error conditions, or what format the '分析结果' (analysis results) will be in. For a data analysis tool with zero annotation coverage, this leaves significant gaps.

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 efficiently structured with clear sections for parameters and return value. Each sentence serves a purpose: stating the tool's function, listing parameters with brief explanations, and mentioning the return. There's no unnecessary verbiage, though the Chinese-only presentation might limit accessibility in some contexts.

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 data analysis tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what '分析结果' (analysis results) contains, what data sources are analyzed, computational characteristics, or error handling. Given the complexity implied by multiple analysis types and time ranges, more context about the analysis process and outputs would be needed for effective use.

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?

With 0% schema description coverage, the description adds value by listing all 4 parameters with basic explanations. It provides the parameter names in Chinese, clarifies that 'analysis_type' has specific optional values, and indicates the temporal nature of 'start_time' and 'end_time'. However, it doesn't provide format details (e.g., timestamp format, robot_id format) or deeper semantic context beyond what's minimally necessary.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool '分析机器人数据' (analyzes robot data), which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like 'generate_robot_report' or 'compare_robots_performance' that might also analyze robot data in different ways. The purpose is understandable but lacks specificity about what kind of analysis it performs beyond the parameter options.

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. With sibling tools like 'generate_robot_report' and 'compare_robots_performance' that might serve similar analytical purposes, the description offers no context about appropriate use cases, prerequisites, or distinctions from these other tools.

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