Skip to main content
Glama
c0h1b4
by c0h1b4

Test Connection

test_connection

Verify database connectivity and retrieve basic server details for Microsoft SQL Server connections.

Instructions

Test the database connection and return basic server information

Input Schema

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

Implementation Reference

  • The `testConnection` function serves as the core handler for testing a database connection. It executes a simple 'SELECT 1' query using the provided ConnectionPool. If the query fails, it throws a descriptive error. This matches the expected logic for a 'test_connection' tool implementation.
    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}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool tests connections and returns server information, but doesn't describe what 'basic server information' includes, whether it performs actual queries or just pings, error handling, timeouts, or authentication requirements. For a connection-testing tool with zero annotation coverage, this leaves significant behavioral gaps.

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 front-loads the core purpose without unnecessary words. Every part earns its place: 'Test the database connection' defines the action, and 'return basic server information' clarifies the outcome. There's zero waste or redundancy.

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 low complexity (2 optional parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose but lacks details on behavior, output format, and usage context. Without annotations or output schema, the agent has incomplete information about what 'basic server information' entails or how to interpret results.

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

Parameters3/5

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

The description adds no parameter-specific information beyond what's in the input schema, which has 100% coverage with clear descriptions for both parameters. The baseline score of 3 is appropriate since the schema adequately documents parameters, and the description doesn't need to compensate, but it also doesn't enhance understanding of parameter usage or interactions.

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 tool's purpose: 'Test the database connection and return basic server information.' It specifies the verb ('test') and resource ('database connection'), and distinguishes itself from sibling tools by focusing on connection testing rather than analysis or listing operations. However, it doesn't explicitly differentiate from 'list_connections' which might be a related sibling.

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. It doesn't mention prerequisites, appropriate contexts, or compare it to sibling tools like 'list_connections' or 'execute_query' for connection validation. The agent must infer usage from the purpose 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/c0h1b4/mssql-mcp-server'

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