Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

get_user_sessions

Retrieve user sessions by ID within a specified date range using API key authentication. Supports analysis of session data for insights into user behavior and interaction patterns.

Instructions

Get sessions for a specific user ID (API key authentication supported)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateNoEnd date in ISO format
startDateNoStart date in ISO format
userIdYesThe user ID to get sessions for

Implementation Reference

  • The handler function that executes the get_user_sessions tool by making an API call to OpenReplay to fetch sessions for a given user ID, with optional date range.
    private async getUserSessions(args: any) { const { userId, startDate, endDate } = args; const response = await this.api.get(`/api/v1/${OPENREPLAY_PROJECT_KEY}/users/${userId}/sessions`, { params: { start_date: startDate ? new Date(startDate).getTime() : undefined, end_date: endDate ? new Date(endDate).getTime() : undefined } }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
  • The tool schema definition including name, description, and input schema for get_user_sessions.
    { name: "get_user_sessions", description: "Get sessions for a specific user ID (API key authentication supported)", inputSchema: { type: "object", properties: { userId: { type: "string", description: "The user ID to get sessions for" }, startDate: { type: "string", description: "Start date in ISO format" }, endDate: { type: "string", description: "End date in ISO format" } }, required: ["userId"] } },
  • src/index.ts:276-277 (registration)
    The switch case that registers and dispatches the get_user_sessions tool call to its handler.
    case "get_user_sessions": return await this.getUserSessions(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