Web Vitals
rybbit_get_performanceRetrieve Core Web Vitals performance metrics (LCP, CLS, INP, FCP, TTFB) with percentile breakdowns. Analyze data by page path, browser, or operating system to monitor website speed and user experience.
Instructions
Get Core Web Vitals performance metrics (LCP, CLS, INP, FCP, TTFB) with p50, p75, p90, p99 percentiles. Optionally break down by page path, browser, or OS.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | Site ID (numeric ID or domain identifier) | |
| startDate | No | Start date in ISO format (YYYY-MM-DD) | |
| endDate | No | End date in ISO format (YYYY-MM-DD) | |
| timeZone | No | IANA timezone (e.g., Europe/Prague). Default: UTC | |
| filters | No | Array of filters. Example: [{parameter:'browser',type:'equals',value:['Chrome']},{parameter:'country',type:'equals',value:['US','DE']}] | |
| pastMinutesStart | No | Alternative to dates: minutes ago start (e.g., 60 = last hour) | |
| pastMinutesEnd | No | Alternative to dates: minutes ago end (default 0 = now) | |
| dimension | No | Break down performance by dimension. Default: overview (aggregated) |
Implementation Reference
- src/tools/performance.ts:51-117 (handler)The "rybbit_get_performance" tool is registered and its logic handler is defined within the `registerPerformanceTools` function in `src/tools/performance.ts`. It fetches either aggregated performance overview or breakdown by dimension (pathname, browser, operating_system) using the RybbitClient.
server.registerTool( "rybbit_get_performance", { title: "Web Vitals", description: "Get Core Web Vitals performance metrics (LCP, CLS, INP, FCP, TTFB) with p50, p75, p90, p99 percentiles. Optionally break down by page path, browser, or OS.", annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true, destructiveHint: false, }, inputSchema: { ...analyticsInputSchema, dimension: dimensionSchema, }, }, async (args) => { try { const { siteId, dimension, ...rest } = args as { siteId: string; dimension?: "overview" | "pathname" | "browser" | "operating_system"; startDate?: string; endDate?: string; timeZone?: string; filters?: Array<{ parameter: string; type: string; value: (string | number)[]; }>; pastMinutesStart?: number; pastMinutesEnd?: number; }; const params = client.buildAnalyticsParams(rest); if ( dimension === "pathname" || dimension === "browser" || dimension === "operating_system" ) { params.dimension = dimension; const data = await client.get<PerformanceByDimension[]>( `/sites/${siteId}/performance/by-dimension`, params ); return { content: [{ type: "text" as const, text: truncateResponse(data) }], }; } const data = await client.get<PerformanceOverview>( `/sites/${siteId}/performance/overview`, params ); return { content: [{ type: "text" as const, text: truncateResponse(data) }], }; } catch (err) { const message = err instanceof Error ? err.message : String(err); return { content: [{ type: "text" as const, text: `Error: ${message}` }], isError: true, }; } } );