Skip to main content
Glama

get_performance_insights

Analyze JMeter test results from JTL files to generate actionable performance insights and recommendations for optimization.

Instructions

Get insights and recommendations for improving performance based on JMeter test results.

Args: jtl_file: Path to the JTL file containing test results

Returns: str: Performance insights and recommendations in a formatted string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jtl_fileYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_performance_insights' MCP tool. It is registered via the @mcp.tool() decorator. The function validates the JTL file, uses TestResultsAnalyzer to perform detailed analysis, extracts insights and recommendations, formats them into a readable string, and includes a test summary.
    @mcp.tool()
    async def get_performance_insights(jtl_file: str) -> str:
        """Get insights and recommendations for improving performance based on JMeter test results.
        
        Args:
            jtl_file: Path to the JTL file containing test results
            
        Returns:
            str: Performance insights and recommendations in a formatted string
        """
        try:
            analyzer = TestResultsAnalyzer()
            
            # Validate file exists
            file_path = Path(jtl_file)
            if not file_path.exists():
                return f"Error: JTL file not found: {jtl_file}"
            
            try:
                # Analyze the file with detailed analysis
                analysis_results = analyzer.analyze_file(file_path, detailed=True)
                
                # Format the results as a string
                result_str = f"Performance Insights for {jtl_file}:\n\n"
                
                # Add insights information
                detailed_info = analysis_results.get("detailed", {})
                insights = detailed_info.get("insights", {})
                
                if not insights:
                    return f"No insights available for {jtl_file}."
                
                # Recommendations
                recommendations = insights.get("recommendations", [])
                if recommendations:
                    result_str += "Recommendations:\n"
                    for i, rec in enumerate(recommendations[:5], 1):  # Show top 5 recommendations
                        result_str += f"{i}. [{rec.get('priority_level', 'medium').upper()}] {rec.get('issue')}\n"
                        result_str += f"   - Recommendation: {rec.get('recommendation')}\n"
                        result_str += f"   - Expected Impact: {rec.get('expected_impact')}\n"
                        result_str += f"   - Implementation Difficulty: {rec.get('implementation_difficulty')}\n\n"
                else:
                    result_str += "No specific recommendations available.\n\n"
                
                # Scaling insights
                scaling_insights = insights.get("scaling_insights", [])
                if scaling_insights:
                    result_str += "Scaling Insights:\n"
                    for i, insight in enumerate(scaling_insights, 1):
                        result_str += f"{i}. {insight.get('topic')}\n"
                        result_str += f"   {insight.get('description')}\n\n"
                else:
                    result_str += "No scaling insights available.\n\n"
                
                # Add summary metrics for context
                summary = analysis_results.get("summary", {})
                result_str += "Test Summary:\n"
                result_str += f"- Total samples: {summary.get('total_samples', 'N/A')}\n"
                result_str += f"- Error rate: {summary.get('error_rate', 'N/A'):.2f}%\n"
                result_str += f"- Average response time: {summary.get('average_response_time', 'N/A'):.2f} ms\n"
                result_str += f"- 95th percentile: {summary.get('percentile_95', 'N/A'):.2f} ms\n"
                result_str += f"- Throughput: {summary.get('throughput', 'N/A'):.2f} requests/second\n"
                
                return result_str
                
            except ValueError as e:
                return f"Error analyzing JTL file: {str(e)}"
            
        except Exception as e:
            return f"Error getting performance insights: {str(e)}"
  • The @mcp.tool() decorator registers the get_performance_insights function as an MCP tool.
    @mcp.tool()
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 states the tool returns 'insights and recommendations in a formatted string,' which gives some output context, but lacks details on permissions, rate limits, error handling, or whether it's read-only/destructive. For a tool with no annotation coverage, this leaves significant behavioral 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 appropriately sized and front-loaded: the first sentence clearly states the purpose, followed by structured 'Args' and 'Returns' sections. However, the 'Args' and 'Returns' labels are somewhat redundant since the schema and output schema exist, and the content could be more integrated. It's efficient but not perfectly streamlined.

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 1 parameter, 0% schema description coverage, no annotations, and an output schema (which handles return values), the description is moderately complete. It covers the basic purpose and parameter intent, but lacks usage guidelines, behavioral details, and differentiation from siblings. For a simple tool, it's adequate but has clear gaps in context.

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?

The description adds minimal parameter semantics: it defines 'jtl_file' as 'Path to the JTL file containing test results,' which clarifies the parameter's purpose beyond the schema's basic type. However, with 0% schema description coverage and only 1 parameter, this provides some value but doesn't fully compensate for the lack of schema details (e.g., file format expectations, path validation). The baseline is 3 due to the single parameter, but the description's addition is limited.

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: 'Get insights and recommendations for improving performance based on JMeter test results.' It specifies the verb ('Get'), resource ('insights and recommendations'), and source ('JMeter test results'). However, it doesn't explicitly differentiate from sibling tools like 'analyze_jmeter_results' or 'identify_performance_bottlenecks', which likely 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 siblings like 'analyze_jmeter_results' and 'identify_performance_bottlenecks' that likely process JMeter results, there's no indication of what distinguishes this tool (e.g., focus on recommendations vs. raw analysis). The only implied context is having JMeter test results, but no explicit when/when-not or alternative tool references.

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

Related 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/QAInsights/jmeter-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server