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)
                }]
            };
        }
    );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It indicates a read operation ('Check') but doesn't disclose behavioral traits such as whether it requires authentication, has rate limits, returns real-time or cached data, or what format the health status output takes. The description adds minimal value beyond the implied read nature.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function with zero waste. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate as a minimum viable explanation. However, it lacks details on output format or behavioral context, which could be helpful for an agent to understand what to expect from the health check.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the baseline is 4 as per the rules. The description doesn't need to add parameter details since there are none, and it appropriately focuses on the tool's purpose without redundant information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Check health status') and the resource ('all database connections'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'list_adapters' or 'server_info', which might also provide related system information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_adapters' or 'server_info'. There's no mention of context, prerequisites, or exclusions, leaving the agent to infer usage based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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