Skip to main content
Glama

validate_all_performance

Run comprehensive website performance tests using PageSpeed Insights, WebPageTest, and GTmetrix to assess and validate site speed metrics.

Instructions

Run all available performance tests (PageSpeed Insights + optionally WebPageTest + optionally GTmetrix).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
pagespeedApiKeyNoOptional PageSpeed API key
gtmetrixApiKeyNoOptional GTmetrix API key
webpagetestEnabledNoRun WebPageTest via browser automation (default: false)
webpagetestWaitForResultsNoWait for WebPageTest to complete (default: false)

Implementation Reference

  • MCP tool handler for 'validate_all_performance'. Validates input arguments using Zod and calls the runAllPerformance orchestrator function, returning JSON results.
    case 'validate_all_performance': {
      const validatedArgs = AllPerformanceArgsSchema.parse(args);
      const result = await runAllPerformance(validatedArgs.url, {
        pagespeed: { apiKey: validatedArgs.pagespeedApiKey },
        webpagetest: validatedArgs.webpagetestEnabled ? {
          waitForResults: validatedArgs.webpagetestWaitForResults
        } : undefined,
        gtmetrix: validatedArgs.gtmetrixApiKey ? { apiKey: validatedArgs.gtmetrixApiKey } : undefined,
      });
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Zod schema defining input validation for the validate_all_performance tool arguments.
    const AllPerformanceArgsSchema = z.object({
      url: z.string().url(),
      pagespeedApiKey: z.string().optional(),
      gtmetrixApiKey: z.string().optional(),
      webpagetestEnabled: z.boolean().optional(),
      webpagetestWaitForResults: z.boolean().optional(),
    });
  • index.ts:232-245 (registration)
    Tool registration in the MCP tools array, including name, description, and input schema.
    {
      name: 'validate_all_performance',
      description: 'Run all available performance tests (PageSpeed Insights + optionally WebPageTest + optionally GTmetrix).',
      inputSchema: {
        type: 'object',
        properties: {
          url: { type: 'string' },
          pagespeedApiKey: { type: 'string', description: 'Optional PageSpeed API key' },
          gtmetrixApiKey: { type: 'string', description: 'Optional GTmetrix API key' },
          webpagetestEnabled: { type: 'boolean', description: 'Run WebPageTest via browser automation (default: false)' },
          webpagetestWaitForResults: { type: 'boolean', description: 'Wait for WebPageTest to complete (default: false)' },
        },
        required: ['url'],
      },
  • Core helper function implementing the logic for validate_all_performance tool. Orchestrates multiple performance analysis tools (PageSpeed Insights always, WebPageTest and GTmetrix optionally) and computes summary metrics.
    export async function runAllPerformance(
      url: string,
      options: PerformanceTestOptions = {}
    ): Promise<AllPerformanceResult> {
      const results: AllPerformanceResult = {
        url,
        timestamp: new Date().toISOString(),
        summary: {
          tools_run: [],
        },
      };
    
      // Always run PageSpeed (free API)
      results.pagespeed = await analyzePageSpeed(url, options.pagespeed || {});
      results.summary.tools_run.push('pagespeed');
    
      // Optional: WebPageTest (free, browser automation)
      if (options.webpagetest) {
        results.webpagetest = await analyzeWebPageTest(url, options.webpagetest);
        results.summary.tools_run.push('webpagetest');
      }
    
      // Optional: GTmetrix (requires API key)
      if (options.gtmetrix?.apiKey) {
        results.gtmetrix = await analyzeGTmetrix(url, options.gtmetrix);
        results.summary.tools_run.push('gtmetrix');
      }
    
      // Calculate average score
      const scores = [results.pagespeed?.performance_score].filter(s => s !== undefined) as number[];
      if (scores.length > 0) {
        results.summary.avg_performance_score = Math.round(scores.reduce((a, b) => a + b, 0) / scores.length);
      }
    
      return results;
    }
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. It mentions the tools involved (PageSpeed Insights, WebPageTest, GTmetrix) but doesn't describe what 'run' entails—whether it's synchronous/asynchronous, what outputs to expect, rate limits, authentication needs beyond API keys, or error handling. For a multi-tool integration with 5 parameters, 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 a single, efficient sentence that front-loads the core purpose. Every word contributes to understanding the tool's scope, though it could be slightly more structured (e.g., clarifying the relationship between parameters and test execution).

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 complexity of running multiple performance tools with 5 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what results to expect, how failures are handled, or the operational impact (e.g., timeouts, costs). For a tool that likely produces rich performance data, this leaves too much undefined.

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 80%, providing a solid baseline. The description adds minimal value beyond the schema—it implies that parameters control which optional tests are run (WebPageTest, GTmetrix) but doesn't explain interactions (e.g., if 'webpagetestEnabled' is false, does it skip WebPageTest entirely?). No additional syntax or format details are provided.

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 action ('Run all available performance tests') and specifies the resources (PageSpeed Insights, WebPageTest, GTmetrix). It distinguishes from siblings by focusing on comprehensive performance testing rather than individual tools or other validation types like accessibility/security. However, it doesn't explicitly differentiate from 'validate_comprehensive' which might also include performance.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by mentioning 'all available performance tests' and optional components, suggesting this is for comprehensive performance assessment. However, it provides no explicit guidance on when to use this versus sibling tools like 'validate_performance_pagespeed' or 'validate_comprehensive', nor does it mention prerequisites or exclusions.

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/cordlesssteve/webby-mcp'

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