get_performance_metrics
Extract user session performance metrics such as page load times, largest contentful paint, and time to interactive. Analyze data by page, browser, device, or country with customizable percentiles for detailed insights.
Instructions
Get performance metrics like page load times, largest contentful paint, time to interactive, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endDate | No | End date in ISO format | |
| groupBy | No | ||
| metrics | Yes | ||
| percentiles | No | Percentiles to calculate (e.g., [50, 75, 90, 95, 99]) | |
| startDate | No | Start date in ISO format |
Implementation Reference
- src/index.ts:463-473 (handler)The handler function that executes the get_performance_metrics tool logic. Currently a stub indicating JWT auth is required.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 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)Dispatch case in the CallToolRequest handler switch statement that invokes the tool handler.case "get_performance_metrics": return await this.getPerformanceMetrics(args);
- src/index.ts:228-251 (schema)Input schema definition for the get_performance_metrics tool.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"] }