Skip to main content
Glama

run_performance_audit

Analyze web page performance metrics to identify optimization opportunities and improve loading speed on ARM64 devices.

Instructions

Run a performance audit on the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'run_performance_audit' tool. It ensures the Chromium instance is running, executes a JavaScript snippet via CDP to gather performance metrics (domContentLoaded, loadComplete, firstPaint, resourceCount, memoryUsage), parses the result, and returns formatted text output.
    async runPerformanceAudit() {
      await this.ensureChromium();
      
      const result = await this.sendCDPCommand('Runtime.evaluate', {
        expression: `
          const perfData = performance.getEntriesByType('navigation')[0];
          const timing = performance.timing;
          
          JSON.stringify({
            domContentLoaded: perfData ? Math.round(perfData.domContentLoadedEventEnd - perfData.domContentLoadedEventStart) : 0,
            loadComplete: perfData ? Math.round(perfData.loadEventEnd - perfData.loadEventStart) : 0,
            firstPaint: timing ? timing.loadEventEnd - timing.navigationStart : 0,
            resourceCount: performance.getEntriesByType('resource').length,
            memoryUsage: performance.memory ? {
              used: Math.round(performance.memory.usedJSHeapSize / 1024 / 1024),
              total: Math.round(performance.memory.totalJSHeapSize / 1024 / 1024),
              limit: Math.round(performance.memory.jsHeapSizeLimit / 1024 / 1024)
            } : 'Not available'
          });
        `,
        returnByValue: true
      });
      
      const performanceMetrics = JSON.parse(result.result?.value || '{}');
      
      return {
        content: [{ type: 'text', text: `Performance Audit Results:\\n${JSON.stringify(performanceMetrics, null, 2)}` }],
      };
    }
  • index.js:287-294 (registration)
    Tool registration in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema (empty object properties).
    {
      name: 'run_performance_audit',
      description: 'Run a performance audit on the current page',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • index.js:381-382 (registration)
    Dispatch case in the CallToolRequestSchema handler's switch statement that routes calls to the runPerformanceAudit method.
    case 'run_performance_audit':
      return await this.runPerformanceAudit();
  • Input schema definition for the tool (accepts no parameters).
    inputSchema: {
      type: 'object',
      properties: {},
    },
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states the action but does not explain what the audit does (e.g., metrics checked, output format), whether it's read-only or has side effects, or any constraints like permissions or rate limits, leaving 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.

Conciseness5/5

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

The description is a single, efficient sentence with no wasted words. It is front-loaded with the core action and target, making it easy to scan and understand quickly.

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 a performance audit tool with no annotations and no output schema, the description is incomplete. It lacks details on what the audit entails, what results to expect, or how it integrates with sibling tools, making it inadequate for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add parameter details, but this is acceptable as there are no parameters to describe, aligning with the baseline for zero parameters.

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's action ('Run a performance audit') and target ('on the current page'), which is clear but vague. It does not specify what a 'performance audit' entails or how it differs from sibling tools like 'run_accessibility_audit' or 'run_seo_audit', missing sibling differentiation.

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 on when to use this tool versus alternatives. The description lacks context about prerequisites (e.g., needing a page loaded) or exclusions, and it does not reference sibling tools for comparison, leaving usage unclear.

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/nfodor/claude-arm64-browser'

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