Skip to main content
Glama

test_connection

Verify database connectivity and retrieve basic server details for MSSQL MCP Server. Input a connection string or named connection to ensure proper database access.

Instructions

Test the database connection and return basic server information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNameNoNamed connection to use (e.g., 'production', 'staging')
connectionStringNoSQL Server connection string (uses default if not provided)

Implementation Reference

  • Helper function that tests the provided database connection pool by executing a simple 'SELECT 1' query. Throws an error if the test fails. This is likely the core logic for a 'test_connection' tool.
    export async function testConnection(pool: ConnectionPool): Promise<void> { try { await pool.request().query('SELECT 1'); } catch (error) { throw new Error(`Failed to connect to database: ${(error as Error).message}`); } }

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/c0h1b4/mssql-mcp-server'

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