get_commandlog
Retrieve recent command log entries from Valkey 8+ instances for monitoring and debugging database operations.
Instructions
Get the most recent entries from COMMANDLOG (Valkey 8+ only, superset of slowlog).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of entries to return (default 25) | |
| instanceId | No | Optional instance ID override |
Implementation Reference
- packages/mcp/src/index.ts:355-369 (handler)The handler for the 'get_commandlog' MCP tool. It fetches data from the API endpoint '/mcp/instance/${id}/commandlog'.
server.tool( 'get_commandlog', 'Get the most recent entries from COMMANDLOG (Valkey 8+ only, superset of slowlog).', { count: z.number().optional().describe('Number of entries to return (default 25)'), instanceId: z.string().optional().describe('Optional instance ID override'), }, async ({ count, instanceId }) => { const id = resolveInstanceId(instanceId); const n = count ?? 25; const data = await apiFetch(`/mcp/instance/${id}/commandlog?count=${n}`); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; },