Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

get_session_events

Retrieve all user interaction events from a specific session, with options to filter by event type or time range for detailed session analysis.

Instructions

Get all events from a session with optional filtering by event type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe session ID
eventTypesNoFilter by specific event types (CLICK, INPUT, LOCATION, CUSTOM, ERROR, etc.)
startTimeNoStart timestamp (ms)
endTimeNoEnd timestamp (ms)

Implementation Reference

  • The handler function that implements the tool logic: extracts the sessionId from arguments, makes an API call to retrieve all events for the session from the OpenReplay API, and returns the events data as a formatted JSON text response.
    private async getSessionEvents(args: any) {
      const { sessionId } = args;
      const response = await this.api.get(`/api/v1/${OPENREPLAY_PROJECT_KEY}/sessions/${sessionId}/events`);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the get_session_events tool, specifying sessionId as required and optional filters for eventTypes, startTime, and endTime.
    inputSchema: {
      type: "object",
      properties: {
        sessionId: { type: "string", description: "The session ID" },
        eventTypes: {
          type: "array",
          items: { type: "string" },
          description: "Filter by specific event types (CLICK, INPUT, LOCATION, CUSTOM, ERROR, etc.)"
        },
        startTime: { type: "number", description: "Start timestamp (ms)" },
        endTime: { type: "number", description: "End timestamp (ms)" }
      },
      required: ["sessionId"]
  • src/index.ts:121-138 (registration)
    Tool registration in the listTools response, including name, description, and input schema.
    {
      name: "get_session_events",
      description: "Get all events from a session with optional filtering by event type",
      inputSchema: {
        type: "object",
        properties: {
          sessionId: { type: "string", description: "The session ID" },
          eventTypes: {
            type: "array",
            items: { type: "string" },
            description: "Filter by specific event types (CLICK, INPUT, LOCATION, CUSTOM, ERROR, etc.)"
          },
          startTime: { type: "number", description: "Start timestamp (ms)" },
          endTime: { type: "number", description: "End timestamp (ms)" }
        },
        required: ["sessionId"]
      }
    },
  • src/index.ts:282-283 (registration)
    Dispatch case in the callToolRequest handler that routes calls to the getSessionEvents method.
    case "get_session_events":
      return await this.getSessionEvents(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 states the tool retrieves events but doesn't mention whether this is a read-only operation, if there are rate limits, authentication requirements, or what the return format looks like (e.g., pagination, structure). This leaves significant gaps for an agent to understand the tool's behavior.

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 purpose and key feature (filtering). It's front-loaded with the main action and avoids unnecessary words, making it highly concise and well-structured.

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 events with filtering, no annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like safety, performance, or return values, leaving the agent with insufficient context to use the tool effectively beyond basic parameter passing.

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?

Schema description coverage is 100%, so the input schema already documents all parameters thoroughly. The description adds minimal value by mentioning 'optional filtering by event type', which aligns with the 'eventTypes' parameter but doesn't provide additional semantic context beyond what the schema offers.

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 ('events from a session'), making the purpose understandable. However, it doesn't distinguish this tool from potential siblings like 'get_session_details' or 'get_user_journey' which might also retrieve session-related data, so it lacks explicit differentiation.

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 mentions 'optional filtering by event type', which implies some usage context, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_session_details' or 'get_user_sessions'. No when-not-to-use or prerequisite information is included.

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