Skip to main content
Glama

wp_performance_export

Export comprehensive WordPress performance reports with analytics, historical data, and customizable time ranges in JSON, CSV, or summary formats.

Instructions

Export comprehensive performance report

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoSpecific site ID for multi-site setups (optional for single site)
formatNoExport format (json, csv, summary)
includeHistoricalNoInclude historical data (default: true)
includeAnalyticsNoInclude analytics and insights (default: true)
timeRangeNoTime range for data export (1h, 6h, 24h, 7d, 30d)

Implementation Reference

  • The core handler function for the 'wp_performance_export' tool. It collects current performance metrics, optional historical data and analytics, formats the report (JSON, CSV, or summary), and returns the export data.
    private async exportPerformanceReport(_client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      return toolWrapper(async () => {
        const {
          site,
          format = "json",
          includeHistorical = true,
          includeAnalytics = true,
          timeRange = "24h",
        } = params as {
          site?: string;
          format?: string;
          includeHistorical?: boolean;
          includeAnalytics?: boolean;
          timeRange?: string;
        };
    
        // Generate comprehensive analytics report
        const report = this.analytics.exportAnalyticsReport();
    
        // Add additional data based on parameters
        const exportData: {
          currentMetrics: PerformanceMetrics;
          [key: string]: unknown;
        } = {
          metadata: {
            generatedAt: new Date().toISOString(),
            site: site || "all",
            timeRange,
            format,
            version: "1.0.0",
          },
          summary: report.summary,
          currentMetrics: this.collector.collectCurrentMetrics(),
        };
    
        if (includeHistorical) {
          const timeframMs = parseTimeframe(timeRange);
          const startTime = Date.now() - timeframMs;
          exportData.historicalData = this.monitor.getHistoricalData(startTime);
        }
    
        if (includeAnalytics) {
          exportData.analytics = {
            trends: report.trends,
            benchmarks: report.benchmarks,
            insights: report.insights,
            anomalies: report.anomalies,
            predictions: report.predictions,
            optimizationPlan: report.optimizationPlan,
          };
        }
    
        // Add aggregated statistics
        exportData.aggregatedStats = {
          cache: this.collector.getAggregatedCacheStats(),
          client: this.collector.getAggregatedClientStats(),
        };
    
        // Add site comparison if multi-site
        if (!site) {
          exportData.siteComparison = this.collector.compareSitePerformance();
        }
    
        // Format output based on requested format
        let formattedOutput: unknown;
        if (format === "csv") {
          formattedOutput = convertToCSV(exportData);
        } else if (format === "summary") {
          formattedOutput = createSummaryReport(exportData);
        } else {
          formattedOutput = exportData;
        }
    
        return {
          success: true,
          data: formattedOutput,
          metadata: {
            timestamp: new Date().toISOString(),
            format,
            dataSize: JSON.stringify(exportData).length,
            site: site || "all",
          },
        };
      });
    }
  • Tool registration in PerformanceTools.getTools(), defining name, description, input parameters schema, and binding to the exportPerformanceReport handler.
    {
      name: "wp_performance_export",
      description: "Export comprehensive performance report",
      parameters: [
        {
          name: "site",
          type: "string",
          description: "Specific site ID for multi-site setups (optional for single site)",
          required: false,
        },
        {
          name: "format",
          type: "string",
          description: "Export format (json, csv, summary)",
          required: false,
        },
        {
          name: "includeHistorical",
          type: "boolean",
          description: "Include historical data (default: true)",
          required: false,
        },
        {
          name: "includeAnalytics",
          type: "boolean",
          description: "Include analytics and insights (default: true)",
          required: false,
        },
        {
          name: "timeRange",
          type: "string",
          description: "Time range for data export (1h, 6h, 24h, 7d, 30d)",
          required: false,
        },
      ],
      handler: this.exportPerformanceReport.bind(this),
    },
  • Higher-level registration in ToolRegistry.registerAllTools() where PerformanceTools class is instantiated and its tools (including wp_performance_export) are registered with the MCP server.
    Object.values(Tools).forEach((ToolClass) => {
      let toolInstance: { getTools(): unknown[] };
    
      // Cache and Performance tools need the clients map
      if (ToolClass.name === "CacheTools" || ToolClass.name === "PerformanceTools") {
        toolInstance = new ToolClass(this.wordpressClients);
      } else {
        toolInstance = new (ToolClass as new () => { getTools(): unknown[] })();
      }
    
      const tools = toolInstance.getTools();
    
      tools.forEach((tool: unknown) => {
        this.registerTool(tool as ToolDefinition);
      });
    });
  • The MCP server.tool() registration with Zod schema built from tool parameters, including site handling for multi-site.
    this.server.tool(
      tool.name,
      tool.description || `WordPress tool: ${tool.name}`,
      parameterSchema,
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Export' implies data retrieval rather than mutation, but the description doesn't specify whether this is a read-only operation, what permissions are required, whether it's resource-intensive, or what the output looks like (file download, data stream, etc.). For a performance export tool with 5 parameters and no annotation coverage, this leaves significant behavioral questions unanswered.

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 extremely concise at just 3 words, with zero wasted language. It's front-loaded with the core action and resource, making it immediately understandable. Every word ('Export', 'comprehensive', 'performance report') contributes essential meaning without redundancy or unnecessary elaboration.

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 the tool's complexity (5 parameters, performance domain) and absence of both annotations and output schema, the description is insufficient. It doesn't explain what a 'comprehensive performance report' contains, how it differs from simpler performance tools, what format the export takes, or what happens after invocation. For a data export tool with multiple configuration options, users need more context about the output and behavioral characteristics.

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 no parameter-specific information beyond what's already in the schema, which has 100% coverage. While the schema thoroughly documents all 5 parameters with descriptions, enums (implied for format and timeRange), and defaults, the description doesn't provide additional context about parameter interactions, typical combinations, or semantic meaning beyond the schema. This meets the baseline for high schema coverage but doesn't add value.

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 'Export comprehensive performance report' clearly states the action (export) and resource (performance report), with 'comprehensive' providing some scope indication. It distinguishes from siblings like wp_performance_stats or wp_performance_history by focusing on export rather than retrieval or monitoring. However, it doesn't explicitly differentiate from wp_performance_benchmark or wp_performance_alerts, which could also involve performance data.

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 when to choose this export tool over wp_performance_stats for quick metrics, wp_performance_history for trend data, or wp_performance_benchmark for comparative analysis. There's no context about prerequisites, timing considerations, or typical use cases for exporting performance reports.

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