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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions retrieving a 'complete journey' but doesn't specify if this is a read-only operation, what permissions are needed, how data is returned (e.g., pagination, format), or any rate limits. This leaves significant gaps for a tool that likely queries user data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy to understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of retrieving user journeys across sessions, no annotations, and no output schema, the description is insufficient. It doesn't explain the return format, potential data volume, or how it differs from sibling tools, leaving the agent with incomplete context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so parameters like 'userId', 'startDate', 'endDate', and 'includeEvents' are well-documented in the schema. The description adds no additional meaning beyond implying a user journey retrieval, which the schema already supports, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('complete journey of a user across multiple sessions'), making the purpose understandable. However, it doesn't explicitly differentiate from siblings like 'get_user_sessions' or 'get_session_details', which might offer similar user-focused data, so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'get_user_sessions' or 'get_session_details', nor does it mention prerequisites or exclusions. It only states what the tool does, not when it's appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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