Skip to main content
Glama

pilot_perf

Measure page load performance timings including DNS, TCP, TTFB, DOM parse, and load metrics for web performance analysis.

Instructions

Get page load performance timings (DNS, TCP, TTFB, DOM parse, load).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation and registration of the 'pilot_perf' MCP tool, which collects and returns performance timings from the browser.
    server.tool(
      'pilot_perf',
      'Get page load performance timings (DNS, TCP, TTFB, DOM parse, load).',
      {},
      async () => {
        await bm.ensureBrowser();
        try {
          const timings = await bm.getPage().evaluate(() => {
            const nav = performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming;
            if (!nav) return 'No navigation timing data available.';
            return {
              dns: Math.round(nav.domainLookupEnd - nav.domainLookupStart),
              tcp: Math.round(nav.connectEnd - nav.connectStart),
              ssl: Math.round(nav.secureConnectionStart > 0 ? nav.connectEnd - nav.secureConnectionStart : 0),
              ttfb: Math.round(nav.responseStart - nav.requestStart),
              download: Math.round(nav.responseEnd - nav.responseStart),
              domParse: Math.round(nav.domInteractive - nav.responseEnd),
              domReady: Math.round(nav.domContentLoadedEventEnd - nav.startTime),
              load: Math.round(nav.loadEventEnd - nav.startTime),
            };
          });
          if (typeof timings === 'string') return { content: [{ type: 'text' as const, text: timings }] };
          const text = Object.entries(timings).map(([k, v]) => `${k.padEnd(12)} ${v}ms`).join('\n');
          return { content: [{ type: 'text' as const, text }] };

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/TacosyHorchata/Pilot'

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