Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

get_user_journey

Track and analyze user interactions across multiple sessions by providing a User ID and date range. Optionally include detailed events for comprehensive behavioral insights.

Instructions

Get the complete journey of a user across multiple sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateNoEnd date in ISO format
includeEventsNoInclude detailed events (default false)
startDateNoStart date in ISO format
userIdYesUser ID or anonymous ID

Implementation Reference

  • The main handler function for the 'get_user_journey' tool. It extracts userId and date parameters from args, calls the OpenReplay API to fetch user sessions, and returns the JSON response as text content.
    private async getUserJourney(args: any) { const { userId, startDate, endDate } = args; // Use the v1 API user sessions endpoint const response = await this.api.get(`/api/v1/${OPENREPLAY_PROJECT_KEY}/users/${userId}/sessions`, { params: { start_date: startDate ? new Date(startDate).getTime() : Date.now() - 30 * 24 * 60 * 60 * 1000, end_date: endDate ? new Date(endDate).getTime() : Date.now() } }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
  • The input schema defining the parameters for the get_user_journey tool: userId (required), startDate, endDate, includeEvents.
    inputSchema: { type: "object", properties: { userId: { type: "string", description: "User ID or anonymous ID" }, startDate: { type: "string", description: "Start date in ISO format" }, endDate: { type: "string", description: "End date in ISO format" }, includeEvents: { type: "boolean", description: "Include detailed events (default false)" } }, required: ["userId"] }
  • src/index.ts:286-287 (registration)
    The switch case in the tool call handler that dispatches to the getUserJourney method.
    case "get_user_journey": return await this.getUserJourney(args);
  • src/index.ts:168-181 (registration)
    The tool registration in the listTools response, including name, description, and inputSchema.
    { name: "get_user_journey", description: "Get the complete journey of a user across multiple sessions", inputSchema: { type: "object", properties: { userId: { type: "string", description: "User ID or anonymous ID" }, startDate: { type: "string", description: "Start date in ISO format" }, endDate: { type: "string", description: "End date in ISO format" }, includeEvents: { type: "boolean", description: "Include detailed events (default false)" } }, required: ["userId"] } },

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