Skip to main content
Glama

wp_performance_benchmark

Compare WordPress site performance against industry benchmarks to identify optimization opportunities and receive improvement recommendations.

Instructions

Compare current performance against industry benchmarks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoSpecific site ID for multi-site setups (optional for single site)
categoryNoBenchmark category (response_time, cache_performance, error_rate, system_resources, all)
includeRecommendationsNoInclude improvement recommendations (default: true)

Implementation Reference

  • Registration of the wp_performance_benchmark tool, including schema (parameters) and handler binding in PerformanceTools.getTools() method.
    {
      name: "wp_performance_benchmark",
      description: "Compare current performance against industry benchmarks",
      parameters: [
        {
          name: "site",
          type: "string",
          description: "Specific site ID for multi-site setups (optional for single site)",
          required: false,
        },
        {
          name: "category",
          type: "string",
          description: "Benchmark category (response_time, cache_performance, error_rate, system_resources, all)",
          required: false,
        },
        {
          name: "includeRecommendations",
          type: "boolean",
          description: "Include improvement recommendations (default: true)",
          required: false,
        },
      ],
      handler: this.getBenchmarkComparison.bind(this),
    },
  • Handler function that executes the tool: collects benchmarks from PerformanceAnalytics, filters by category, generates recommendations, formats results using helpers, and returns structured comparison data.
    private async getBenchmarkComparison(_client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      return toolWrapper(async () => {
        const {
          site,
          category = "all",
          includeRecommendations = true,
        } = params as {
          site?: string;
          category?: string;
          includeRecommendations?: boolean;
        };
    
        // Get benchmark comparisons
        const benchmarks = this.analytics.benchmarkPerformance() as BenchmarkComparison[];
    
        // Filter by category if specified
        let filteredBenchmarks = benchmarks;
        if (category !== "all") {
          const categoryMap: Record<string, string> = {
            response_time: "Response Time",
            cache_performance: "Cache Hit Rate",
            error_rate: "Error Rate",
            system_resources: "Memory Usage",
          };
          const targetCategory = categoryMap[category as string];
          if (targetCategory) {
            filteredBenchmarks = benchmarks.filter((b) => b.category === targetCategory);
          }
        }
    
        // Get recommendations if requested
        let recommendations = null;
        if (includeRecommendations) {
          const insights = this.analytics.generateInsights();
          recommendations = insights
            .filter((insight) => insight.category === "optimization")
            .map((insight) => ({
              title: insight.title,
              description: insight.description,
              priority: insight.priority,
              estimatedImprovement: insight.estimatedImprovement,
              implementationEffort: insight.implementationEffort,
            }));
        }
    
        return {
          success: true,
          data: {
            benchmarks: filteredBenchmarks.map((benchmark) => ({
              ...benchmark,
              status: formatBenchmarkStatus(benchmark.status),
              improvement:
                benchmark.improvement > 0
                  ? {
                      needed: benchmark.improvement,
                      description: getBenchmarkImprovementDescription(benchmark),
                    }
                  : null,
            })),
            overallRanking: calculateOverallRanking(benchmarks),
            recommendations: recommendations || [],
            metadata: {
              timestamp: new Date().toISOString(),
              category,
              site: site || "all",
              benchmarkVersion: "2024-industry-standards",
            },
          },
        };
      });
    }
  • Helper function to format benchmark status with emojis, used in the handler for output formatting.
    export function formatBenchmarkStatus(status: string): string {
      const statusMap: Record<string, string> = {
        excellent: "🟢 Excellent",
        good: "🟡 Good",
        average: "🟠 Average",
        below_average: "🔴 Below Average",
        poor: "âš« Poor",
      };
      return statusMap[status] || status;
    }
  • Helper to generate human-readable improvement descriptions for benchmarks, used conditionally in the handler.
    export function getBenchmarkImprovementDescription(benchmark: BenchmarkComparison): string {
      const improvements: Record<string, string> = {
        "Response Time": `Reduce by ${benchmark.improvement.toFixed(0)}ms`,
        "Cache Hit Rate": `Increase by ${benchmark.improvement.toFixed(1)}%`,
        "Error Rate": `Reduce by ${benchmark.improvement.toFixed(2)}%`,
        "Memory Usage": `Reduce by ${benchmark.improvement.toFixed(0)}%`,
      };
      return improvements[benchmark.category] || `Improve by ${benchmark.improvement}`;
    }
  • Helper to compute overall performance ranking percentile and status from benchmark results, used in handler summary.
    export function calculateOverallRanking(benchmarks: BenchmarkComparison[]): { percentile: number; status: string } {
      const statuses = benchmarks.map((b) => b.status);
      const excellentCount = statuses.filter((s) => s === "excellent").length;
      const goodCount = statuses.filter((s) => s === "good").length;
    
      const percentile = ((excellentCount + goodCount * 0.8) / statuses.length) * 100;
    
      let status = "Needs Improvement";
      if (percentile >= 90) status = "Top Performer";
      else if (percentile >= 75) status = "Above Average";
      else if (percentile >= 50) status = "Average";
    
      return { percentile: Math.round(percentile), status };
    }
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 compares performance against benchmarks but doesn't describe what data is compared, how benchmarks are sourced, whether it's a read-only operation, potential rate limits, or the format of results. For a tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, clear sentence: 'Compare current performance against industry benchmarks.' It is front-loaded with the core purpose, has zero wasted words, and is appropriately sized for the tool's complexity. Every word earns its place by conveying essential information efficiently.

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 moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate. It states the purpose but lacks details on behavior, usage context, or result format. With schema coverage at 100%, parameters are documented, but the description doesn't compensate for missing annotations or output schema, leaving gaps in overall completeness.

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?

Schema description coverage is 100%, so the schema already documents all three parameters (site, category, includeRecommendations) with descriptions. The tool description adds no additional meaning beyond the schema, such as explaining the significance of categories or how recommendations are generated. Baseline 3 is appropriate when the schema handles parameter documentation effectively.

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 current performance against industry benchmarks.' It specifies the verb 'compare' and the resource 'current performance' against 'industry benchmarks.' However, it doesn't explicitly differentiate from sibling tools like wp_performance_stats or wp_performance_history, which might also involve performance data but serve different functions.

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, context for benchmarking, or how it differs from sibling tools such as wp_performance_stats (which might show stats without comparison) or wp_performance_optimize (which might suggest improvements). This lack of comparative context leaves usage ambiguous.

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/docdyhr/mcp-wordpress'

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