get_performance_metrics
Retrieve web performance metrics including page load times, largest contentful paint, and time to interactive to analyze user experience and identify optimization opportunities.
Instructions
Get performance metrics like page load times, largest contentful paint, time to interactive, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | No | Start date in ISO format | |
| endDate | No | End date in ISO format | |
| metrics | Yes | ||
| groupBy | No | ||
| percentiles | No | Percentiles to calculate (e.g., [50, 75, 90, 95, 99]) |
Implementation Reference
- src/index.ts:463-473 (handler)The handler function that implements the logic for the 'get_performance_metrics' tool. Currently, it returns a message indicating that JWT authentication is required for full access.private async getPerformanceMetrics(args: any) { // Performance metrics require JWT authentication return { content: [ { type: "text", text: "Performance metrics are not available via API key authentication. JWT authentication is required for this feature.", }, ], }; }
- src/index.ts:225-252 (registration)Registration of the 'get_performance_metrics' tool in the listTools response, including name, description, and input schema definition.{ name: "get_performance_metrics", description: "Get performance metrics like page load times, largest contentful paint, time to interactive, etc.", inputSchema: { type: "object", properties: { startDate: { type: "string", description: "Start date in ISO format" }, endDate: { type: "string", description: "End date in ISO format" }, metrics: { type: "array", items: { type: "string", enum: ["load_time", "dom_complete", "first_paint", "first_contentful_paint", "largest_contentful_paint", "time_to_interactive", "cpu_load", "memory_usage"] } }, groupBy: { type: "array", items: { type: "string", enum: ["page", "browser", "device", "country"] } }, percentiles: { type: "array", items: { type: "number" }, description: "Percentiles to calculate (e.g., [50, 75, 90, 95, 99])" } }, required: ["metrics"] } },
- src/index.ts:292-293 (registration)The switch case in the CallToolRequest handler that routes calls to the getPerformanceMetrics method.case "get_performance_metrics": return await this.getPerformanceMetrics(args);