Skip to main content
Glama

server_health

Monitor database connection health across multiple database types to ensure reliable data access and identify connectivity issues.

Instructions

Check health status of all database connections

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'server_health' tool. It creates a health report including server status, timestamp, and health checks for each registered database adapter by calling adapter.getHealth(). Errors are caught and reported. Returns JSON-formatted text content.
    async () => { const health: Record<string, unknown> = { server: 'healthy', timestamp: new Date().toISOString(), adapters: {} }; for (const [id, adapter] of this.adapters) { try { const adapterHealth = await adapter.getHealth(); (health['adapters'] as Record<string, unknown>)[id] = adapterHealth; } catch (error) { (health['adapters'] as Record<string, unknown>)[id] = { connected: false, error: error instanceof Error ? error.message : 'Unknown error' }; } } return { content: [{ type: 'text' as const, text: JSON.stringify(health, null, 2) }] }; }
  • Registration of the 'server_health' tool using the deprecated this.server.tool() method. Includes tool name, description, empty input schema ({}), and inline async handler function.
    this.server.tool( 'server_health', 'Check health status of all database connections', {}, async () => { const health: Record<string, unknown> = { server: 'healthy', timestamp: new Date().toISOString(), adapters: {} }; for (const [id, adapter] of this.adapters) { try { const adapterHealth = await adapter.getHealth(); (health['adapters'] as Record<string, unknown>)[id] = adapterHealth; } catch (error) { (health['adapters'] as Record<string, unknown>)[id] = { connected: false, error: error instanceof Error ? error.message : 'Unknown error' }; } } return { content: [{ type: 'text' as const, text: JSON.stringify(health, null, 2) }] }; } );

Other Tools

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/neverinfamous/db-mcp'

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