Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

get_user_journey

Retrieve a user's complete journey across multiple sessions to analyze behavior patterns and interactions over time.

Instructions

Get the complete journey of a user across multiple sessions

Input Schema

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

Implementation Reference

  • The handler function for get_user_journey tool. It fetches the user's sessions from the OpenReplay API using the v1 endpoint for users/{userId}/sessions, with optional date range parameters, 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), }, ], }; }
  • Input schema defining parameters for the get_user_journey tool: required userId (string), optional startDate/endDate (ISO strings), includeEvents (boolean).
    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:168-181 (registration)
    Registration of the get_user_journey tool in the ListTools response, including name, description, and input schema.
    { 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"] } },
  • src/index.ts:286-287 (registration)
    Registration/dispatch of the get_user_journey tool in the CallToolRequestHandler switch statement.
    case "get_user_journey": return await this.getUserJourney(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