Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

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
NameRequiredDescriptionDefault
sessionIdYesThe session ID
eventTypesNoFilter by specific event types (CLICK, INPUT, LOCATION, CUSTOM, ERROR, etc.)
startTimeNoStart timestamp (ms)
endTimeNoEnd timestamp (ms)

Implementation Reference

  • 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), }, ], }; }
  • 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);

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