Site Overview
rybbit_get_overviewRetrieve aggregated website analytics metrics including sessions, pageviews, unique users, bounce rate, and session duration for specified date ranges with customizable filters.
Instructions
Get aggregated overview metrics for a site: sessions, pageviews, unique users, pages per session, bounce rate, and average session duration. Supports date range and filters.
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) |
Implementation Reference
- src/tools/overview.ts:65-80 (registration)Registration of the 'rybbit_get_overview' tool.
server.registerTool( "rybbit_get_overview", { title: "Site Overview", description: "Get aggregated overview metrics for a site: sessions, pageviews, unique users, pages per session, bounce rate, and average session duration. Supports date range and filters.", inputSchema: { ...analyticsInputSchema, }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, - src/tools/overview.ts:81-113 (handler)The handler function for 'rybbit_get_overview' which fetches overview metrics from the Rybbit API.
async (args) => { try { const params = client.buildAnalyticsParams({ startDate: args.startDate, endDate: args.endDate, timeZone: args.timeZone, filters: args.filters, pastMinutesStart: args.pastMinutesStart, pastMinutesEnd: args.pastMinutesEnd, }); const data = await client.get<OverviewMetrics>( `/sites/${args.siteId}/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, }; } } );