Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

get_session_events

Extract and filter session events by type or time range to analyze user behavior. Retrieve detailed data for insights into clicks, inputs, errors, and custom interactions.

Instructions

Get all events from a session with optional filtering by event type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endTimeNoEnd timestamp (ms)
eventTypesNoFilter by specific event types (CLICK, INPUT, LOCATION, CUSTOM, ERROR, etc.)
sessionIdYesThe session ID
startTimeNoStart timestamp (ms)

Implementation Reference

  • The handler function that executes the tool: extracts sessionId, calls OpenReplay API to get events, returns JSON stringified response.
    private async getSessionEvents(args: any) { const { sessionId } = args; const response = await this.api.get(`/api/v1/${OPENREPLAY_PROJECT_KEY}/sessions/${sessionId}/events`); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
  • Input schema definition for the get_session_events tool, defining parameters like sessionId (required), eventTypes, startTime, endTime.
    inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "The session ID" }, eventTypes: { type: "array", items: { type: "string" }, description: "Filter by specific event types (CLICK, INPUT, LOCATION, CUSTOM, ERROR, etc.)" }, startTime: { type: "number", description: "Start timestamp (ms)" }, endTime: { type: "number", description: "End timestamp (ms)" } }, required: ["sessionId"] }
  • src/index.ts:121-138 (registration)
    Tool registration in the listTools handler: defines name, description, and input schema.
    { name: "get_session_events", description: "Get all events from a session with optional filtering by event type", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "The session ID" }, eventTypes: { type: "array", items: { type: "string" }, description: "Filter by specific event types (CLICK, INPUT, LOCATION, CUSTOM, ERROR, etc.)" }, startTime: { type: "number", description: "Start timestamp (ms)" }, endTime: { type: "number", description: "End timestamp (ms)" } }, required: ["sessionId"] } },
  • src/index.ts:282-283 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement, routing to the handler.
    case "get_session_events": return await this.getSessionEvents(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