Skip to main content
Glama

get_connection_health

Check SQL Server connection pool health metrics and diagnose connectivity issues to maintain database reliability and performance.

Instructions

Get connection pool health metrics and diagnostics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary handler method for the 'get_connection_health' MCP tool. Retrieves connection health metrics from ConnectionManager and pool stats from PerformanceMonitor, formats as structured JSON response for MCP protocol.
    getConnectionHealth() { const poolStats = this.performanceMonitor.getPoolStats(); const connectionHealth = this.connectionManager.getConnectionHealth ? this.connectionManager.getConnectionHealth() : { connected: true, status: 'Connected' }; return [ { type: 'text', text: JSON.stringify( { success: true, data: { connection: connectionHealth, pool: poolStats } }, null, 2 ) } ]; }
  • Tool registration in the central tool registry. Defines the tool name, description, and empty input schema. Included in PERFORMANCE_TOOLS array and exported via getAllTools() for MCP list_tools requests.
    { name: 'get_connection_health', description: 'Get connection pool health metrics and diagnostics', inputSchema: { type: 'object', properties: {} } }
  • Core helper function providing detailed connection pool health metrics: connection status, pool statistics (size, available, pending, borrowed), and optional SSL information.
    getConnectionHealth() { if (!this.pool) { return { connected: false, status: 'No connection pool' }; } const health = { connected: this.pool.connected, connecting: this.pool.connecting, healthy: this.pool.healthy, status: this.pool.connected ? 'Connected' : 'Disconnected', pool: { size: this.pool.size, available: this.pool.available, pending: this.pool.pending, borrowed: this.pool.borrowed } }; // Try to extract SSL/TLS certificate information if encryption is enabled if (this.pool.connected && process.env.SQL_SERVER_ENCRYPT === 'true') { health.ssl = this._extractSSLInfo(); } return health; }
  • MCP tool dispatcher switch case that routes 'get_connection_health' tool calls to the main getConnectionHealth() handler method.
    case 'get_connection_health': return { content: this.getConnectionHealth() };

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/egarcia74/warp-sql-server-mcp'

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