Skip to main content
Glama
srthkdev

DBeaver MCP Server

by srthkdev

test_connection

Verify connectivity to DBeaver database connections by testing if the specified connection can be established successfully.

Instructions

Test connectivity to a DBeaver connection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionIdYesThe ID or name of the DBeaver connection to test

Implementation Reference

  • Primary handler function for the 'test_connection' tool. It sanitizes the connection ID, retrieves the connection configuration, tests the connection via dbeaverClient, and returns the test result as JSON.
    private async handleTestConnection(args: { connectionId: string }) {
      const connectionId = sanitizeConnectionId(args.connectionId);
      const connection = await this.configParser.getConnection(connectionId);
      
      if (!connection) {
        throw new McpError(ErrorCode.InvalidParams, `Connection not found: ${connectionId}`);
      }
      
      const testResult = await this.dbeaverClient.testConnection(connection);
      
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify(testResult, null, 2),
        }],
      };
    }
  • src/index.ts:377-390 (registration)
    Tool registration in the listTools response, defining the name, description, and input schema for 'test_connection'.
    {
      name: 'test_connection',
      description: 'Test connectivity to a DBeaver connection',
      inputSchema: {
        type: 'object',
        properties: {
          connectionId: {
            type: 'string',
            description: 'The ID or name of the DBeaver connection to test',
          },
        },
        required: ['connectionId'],
      },
    },
  • Dispatch case in the CallToolRequestHandler that routes 'test_connection' calls to the handleTestConnection method.
    case 'test_connection':
      return await this.handleTestConnection(args as { connectionId: string });
  • Core helper method in DBeaverClient that performs the actual connection test by executing a database-specific test query and returning success/error details.
    async testConnection(connection: DBeaverConnection): Promise<ConnectionTest> {
      const startTime = Date.now();
      
      try {
        // Simple test query based on database type
        const testQuery = this.getTestQuery(connection.driver);
        const result = await this.executeQuery(connection, testQuery);
        
        return {
          connectionId: connection.id,
          success: true,
          responseTime: Date.now() - startTime,
          databaseVersion: this.extractVersionFromResult(result)
        };
      } catch (error) {
        return {
          connectionId: connection.id,
          success: false,
          error: error instanceof Error ? error.message : String(error),
          responseTime: Date.now() - startTime
        };
      }
    }
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 connectivity but doesn't describe what 'testing' entails (e.g., whether it performs a ping, authentication check, or network test), what the expected output or error responses are, or any side effects like logging. This is inadequate for a tool that could involve network operations.

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, direct sentence that efficiently conveys the core purpose without any wasted words. It is 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.

Completeness2/5

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

Given the complexity of testing connectivity (which may involve network calls, authentication, or error handling), the description is insufficient. With no annotations, no output schema, and minimal behavioral details, it doesn't provide enough context for an agent to understand how to interpret results or handle failures, making it incomplete for this type of operation.

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 input schema has 100% description coverage, with the parameter 'connectionId' clearly documented as 'The ID or name of the DBeaver connection to test.' The description doesn't add any additional meaning beyond this, such as format examples or constraints, so it meets the baseline score of 3 where the schema does the heavy lifting.

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 as 'Test connectivity to a DBeaver connection,' which is a specific verb ('test') applied to a resource ('DBeaver connection'). However, it doesn't explicitly differentiate from sibling tools like 'get_connection_info' or 'list_connections,' which might provide related but distinct functionality, preventing a perfect score.

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. For example, it doesn't specify if this is for diagnostic purposes, pre-operation checks, or how it differs from tools like 'get_connection_info' that might retrieve connection details without testing. This lack of context leaves the agent without clear usage instructions.

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/srthkdev/omnisql-mcp'

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