Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

search_sessions

Search and filter user sessions in OpenReplay by date, criteria, and pagination to analyze behavior patterns.

Instructions

[Requires userId with API key auth] Search and filter sessions. Full search requires JWT authentication.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNoRequired: User ID to search sessions for
startDateNoStart date in ISO format
endDateNoEnd date in ISO format
filtersNoFilters (limited with API key auth)
limitNoNumber of sessions to return
offsetNoOffset for pagination
sortNo

Implementation Reference

  • The handler function that executes the search_sessions tool logic, querying OpenReplay API for user sessions with date filtering.
    private async searchSessions(args: any) { // Note: The v1 API with API keys has limited endpoints // For full session search, JWT authentication is required // This uses the user sessions endpoint as an alternative if (!args.userId) { return { content: [ { type: "text", text: "Session search requires a userId when using API key authentication. For full search capabilities, JWT authentication is needed.", }, ], }; } const response = await this.api.get(`/api/v1/${OPENREPLAY_PROJECT_KEY}/users/${args.userId}/sessions`, { params: { start_date: args.startDate ? new Date(args.startDate).getTime() : Date.now() - 7 * 24 * 60 * 60 * 1000, end_date: args.endDate ? new Date(args.endDate).getTime() : Date.now() } }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
  • The tool schema definition including name, description, and input schema for search_sessions.
    { name: "search_sessions", description: "[Requires userId with API key auth] Search and filter sessions. Full search requires JWT authentication.", inputSchema: { type: "object", properties: { userId: { type: "string", description: "Required: User ID to search sessions for" }, startDate: { type: "string", description: "Start date in ISO format" }, endDate: { type: "string", description: "End date in ISO format" }, filters: { type: "array", description: "Filters (limited with API key auth)", items: { type: "object", properties: { type: { type: "string", description: "Filter type" }, operator: { type: "string", description: "Operator" }, value: { type: ["string", "number", "array"], description: "Filter value" } } } }, limit: { type: "number", description: "Number of sessions to return" }, offset: { type: "number", description: "Offset for pagination" }, sort: { type: "object", properties: { field: { type: "string", description: "Field to sort by" }, order: { type: "string", enum: ["asc", "desc"], description: "Sort order" } } } }, required: [] } },
  • src/index.ts:278-279 (registration)
    The switch case that registers and dispatches to the search_sessions handler.
    case "search_sessions": return await this.searchSessions(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