Skip to main content
Glama

get_connection_health

Check SQL Server connection pool health metrics and diagnose connectivity issues to ensure reliable database operations.

Instructions

Get connection pool health metrics and diagnostics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler method that retrieves connection health from ConnectionManager, adds pool stats from PerformanceMonitor, and formats as JSON response.
    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 schema definition including name, description, and empty input schema (no parameters required). Used for MCP tool listing and validation.
    { name: 'get_connection_health', description: 'Get connection pool health metrics and diagnostics', inputSchema: { type: 'object', properties: {} } }
  • index.js:241-243 (registration)
    Registers the ListTools handler which returns all tools including get_connection_health via getAllTools() from tool-registry.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getAllTools() }));
  • Core helper method that inspects the SQL Server connection pool and returns detailed health metrics including connection status, pool stats, and optional SSL info.
    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; }

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