Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

aggregate_sessions

Analyze user session data by calculating metrics like duration, error rates, and page views, grouped by time periods, devices, or locations to identify behavioral patterns.

Instructions

Aggregate session data with various metrics and groupings

Input Schema

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

Implementation Reference

  • The handler function that implements the logic for the 'aggregate_sessions' tool. Currently, it returns a message indicating 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.", }, ], }; }
  • The input schema definition for the 'aggregate_sessions' tool, specifying parameters like startDate, endDate, metrics, groupBy, and filters.
    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"]
  • src/index.ts:139-167 (registration)
    The tool registration in the listTools response, including name, description, and input schema for 'aggregate_sessions'.
    { 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"] } },
  • The dispatch case in the CallToolRequest 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