Skip to main content
Glama

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
NameRequiredDescriptionDefault
instanceIdNoOptional 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);
        }
  • 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) }],
        };
      },

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