get_cluster_node_stats
Retrieve per-node performance statistics including memory usage, operations per second, connected clients, replication offset, and CPU metrics to identify hot nodes, lagging replicas, or uneven load distribution in your database cluster.
Instructions
Get per-node performance stats: memory usage, ops/sec, connected clients, replication offset, and CPU. Use this to identify hot nodes, lagging replicas, or uneven load distribution.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceId | No | Optional instance ID override |
Implementation Reference
- The actual implementation of cluster node statistics calculation.
async getClusterNodeStats(connectionId?: string): Promise<NodeStats[]> { const nodes = await this.discoveryService.discoverNodes(connectionId); const statsPromises = nodes.map((node) => this.getNodeStats(node, connectionId)); const results = await Promise.allSettled(statsPromises); const allStats: NodeStats[] = []; for (const result of results) { if (result.status === 'fulfilled' && result.value) { allStats.push(result.value); } - packages/mcp/src/index.ts:583-593 (handler)The MCP tool registration and definition for get_cluster_node_stats.
server.tool( 'get_cluster_node_stats', 'Get per-node performance stats: memory usage, ops/sec, connected clients, replication offset, and CPU. Use this to identify hot nodes, lagging replicas, or uneven load distribution.', { instanceId: z.string().optional().describe('Optional instance ID override') }, async ({ instanceId }) => { const id = resolveInstanceId(instanceId); const data = await apiFetch(`/mcp/instance/${id}/cluster/node-stats`); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; },