get_session_events
Retrieve all user interaction events from a specific session, with options to filter by event type or time range for detailed session analysis.
Instructions
Get all events from a session with optional filtering by event type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | The session ID | |
| eventTypes | No | Filter by specific event types (CLICK, INPUT, LOCATION, CUSTOM, ERROR, etc.) | |
| startTime | No | Start timestamp (ms) | |
| endTime | No | End timestamp (ms) |
Implementation Reference
- src/index.ts:392-404 (handler)The handler function that implements the tool logic: extracts the sessionId from arguments, makes an API call to retrieve all events for the session from the OpenReplay API, and returns the events data as a formatted JSON text 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), }, ], }; }
- src/index.ts:124-136 (schema)Input schema definition for the get_session_events tool, specifying sessionId as required and optional filters for eventTypes, startTime, and 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 response, including 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 case in the callToolRequest handler that routes calls to the getSessionEvents method.case "get_session_events": return await this.getSessionEvents(args);