Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

aggregate_sessions

Analyze user session data by specifying metrics like count, avg_duration, error_rate, and grouping by hour, day, browser, or country. Use filters and date ranges to extract insights from session analytics.

Instructions

Aggregate session data with various metrics and groupings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateNoEnd date in ISO format
filtersNoSame filter format as search_sessions
groupByNoFields to group by
metricsYesMetrics to calculate
startDateNoStart date in ISO format

Implementation Reference

  • The handler function for the 'aggregate_sessions' tool. It returns a message stating that aggregation is not supported via API key authentication.
    private async aggregateSessions(args: any) { // Aggregation requires access to the full sessions/search endpoint // which is not available via API key authentication return { content: [ { type: "text", text: "Session aggregation is not available via API key authentication. You can retrieve individual user sessions instead.", }, ], }; }
  • src/index.ts:139-167 (registration)
    Registration of the 'aggregate_sessions' tool in the ListTools response, including name, description, and detailed input schema.
    { name: "aggregate_sessions", description: "Aggregate session data with various metrics and groupings", 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", description: "Metrics to calculate", items: { type: "string", enum: ["count", "avg_duration", "error_rate", "bounce_rate", "unique_users", "page_views"] } }, groupBy: { type: "array", description: "Fields to group by", items: { type: "string", enum: ["hour", "day", "week", "browser", "device", "country", "page", "error_type"] } }, filters: { type: "array", description: "Same filter format as search_sessions" } }, required: ["metrics"] } },
  • Input schema definition for the 'aggregate_sessions' 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", description: "Metrics to calculate", items: { type: "string", enum: ["count", "avg_duration", "error_rate", "bounce_rate", "unique_users", "page_views"] } }, groupBy: { type: "array", description: "Fields to group by", items: { type: "string", enum: ["hour", "day", "week", "browser", "device", "country", "page", "error_type"] } }, filters: { type: "array", description: "Same filter format as search_sessions" } }, required: ["metrics"]
  • Dispatch case in the main tool call handler that routes to the aggregateSessions method.
    case "aggregate_sessions": return await this.aggregateSessions(args);

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/lekt9/openreplay-mcp'

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