Skip to main content
Glama

get_slowlog

Retrieve recent slow commands from Valkey/Redis slowlog to identify performance bottlenecks and optimize database queries.

Instructions

Get the most recent slow commands from the slowlog.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of entries to return (default 25)
instanceIdNoOptional instance ID override

Implementation Reference

  • The handler logic for the 'get_slowlog' tool is defined in proprietary/ai/tools/monitoring-tools.ts as a LangChain tool. It calls the metricsService.getSlowLog method and formats the results for the LLM.
    const getSlowlog = tool(
      async ({ count, connectionId }: { count: number; connectionId?: string }) => {
        // Parameters: count, excludeClientName, startTime, endTime, connectionId
        const entries = await metricsService.getSlowLog(count, undefined, undefined, undefined, connectionId);
        return JSON.stringify(
          entries.slice(0, count).map((e) => ({
            command: e.command.slice(0, 5).join(' '),
            duration_ms: (e.duration / 1000).toFixed(2),
            timestamp: new Date(e.timestamp * 1000).toISOString(),
            client: e.clientAddress,
          }))
        );
      },

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/BetterDB-inc/monitor'

If you have feedback or need assistance with the MCP directory API, please join our Discord server