Skip to main content
Glama
lekt9

OpenReplay MCP Server

by lekt9

execute_custom_query

Run custom SQL-like queries on OpenReplay session data to analyze user behavior, track errors, and measure performance metrics.

Instructions

Execute a custom query on the session data (supports SQL-like syntax for ClickHouse)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesCustom query to execute
parametersNoQuery parameters

Implementation Reference

  • The handler function that implements the logic for the 'execute_custom_query' tool. It currently returns a message indicating that custom queries are not supported and suggests using other tools.
    private async executeCustomQuery(args: any) {
      // OpenReplay doesn't expose direct query access, but we can use the search with complex filters
      const { query, parameters } = args;
      
      return {
        content: [
          {
            type: "text",
            text: "Custom queries are not directly supported. Please use the specific search and filter tools instead.",
          },
        ],
      };
    }
  • Input schema definition for the 'execute_custom_query' tool, specifying the expected parameters.
    inputSchema: {
      type: "object",
      properties: {
        query: { type: "string", description: "Custom query to execute" },
        parameters: { type: "object", description: "Query parameters" }
      },
      required: ["query"]
  • src/index.ts:253-264 (registration)
    Registration of the 'execute_custom_query' tool in the list of available tools returned by list_tools handler.
    {
      name: "execute_custom_query",
      description: "Execute a custom query on the session data (supports SQL-like syntax for ClickHouse)",
      inputSchema: {
        type: "object",
        properties: {
          query: { type: "string", description: "Custom query to execute" },
          parameters: { type: "object", description: "Query parameters" }
        },
        required: ["query"]
      }
    }
  • src/index.ts:294-295 (registration)
    Dispatch case in the CallToolRequestHandler switch statement that routes to the executeCustomQuery method.
    case "execute_custom_query":
      return await this.executeCustomQuery(args);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'SQL-like syntax for ClickHouse' which gives some technical context, but doesn't disclose important behavioral traits like whether this is read-only or can modify data, what permissions are required, rate limits, error handling, or what format results are returned in. The description is insufficient for a tool that executes arbitrary queries.

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

Conciseness4/5

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

The description is a single, efficient sentence that communicates the core functionality. It's appropriately sized for what it does cover, though it could be more comprehensive given the tool's complexity.

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?

For a tool that executes arbitrary queries with no annotations and no output schema, the description is inadequate. It doesn't explain what data can be queried, what SQL-like syntax is supported, what happens on execution errors, or what the return format looks like. The complexity of the tool demands more complete documentation.

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 schema already documents both parameters fully. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it doesn't explain query syntax examples, parameter binding mechanisms, or provide guidance on constructing valid queries.

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 tool executes a custom query on session data using SQL-like syntax for ClickHouse. It specifies the verb ('execute'), resource ('custom query on session data'), and technology context ('ClickHouse'), but doesn't explicitly differentiate from sibling tools like aggregate_sessions or search_sessions that might also query session data.

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. With multiple sibling tools for querying session data (aggregate_sessions, get_session_details, search_sessions, etc.), there's no indication of when this custom query approach is preferred over the more specialized tools.

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