Skip to main content
Glama
srthkdev

DBeaver MCP Server

by srthkdev

drop_table

Remove a database table using DBeaver connections with built-in safety confirmation to prevent accidental data loss.

Instructions

Remove a table from the database with safety confirmation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmYesSafety confirmation flag (must be true)
connectionIdYesThe ID or name of the DBeaver connection
tableNameYesName of the table to drop

Implementation Reference

  • The main handler function that executes the drop_table tool logic: validates inputs, checks safety confirmation, verifies table existence, constructs and executes DROP TABLE query via DBeaver client.
    private async handleDropTable(args: { connectionId: string; tableName: string; confirm: boolean }) {
      const connectionId = sanitizeConnectionId(args.connectionId);
      const tableName = args.tableName;
      
      if (!tableName) {
        throw new McpError(ErrorCode.InvalidParams, 'Table name is required');
      }
      
      if (!args.confirm) {
        return {
          content: [{
            type: 'text' as const,
            text: JSON.stringify({ 
              success: false, 
              message: 'Safety confirmation required. Set confirm=true to proceed with dropping the table.' 
            }, null, 2),
          }],
        };
      }
      
      const connection = await this.configParser.getConnection(connectionId);
      if (!connection) {
        throw new McpError(ErrorCode.InvalidParams, `Connection not found: ${connectionId}`);
      }
      
      // Check if table exists first
      try {
        await this.dbeaverClient.getTableSchema(connection, tableName);
      } catch (error) {
        throw new McpError(ErrorCode.InvalidParams, `Table '${tableName}' does not exist or cannot be accessed`);
      }
      
      const dropQuery = `DROP TABLE "${tableName}"`;
      const result = await this.dbeaverClient.executeQuery(connection, dropQuery);
      
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({ 
            success: true, 
            message: `Table '${tableName}' dropped successfully`,
            executionTime: result.executionTime 
          }, null, 2),
        }],
      };
    }
  • Tool definition including name, description, and input schema specifying required parameters: connectionId, tableName, and confirm boolean.
    {
      name: 'drop_table',
      description: 'Remove a table from the database with safety confirmation',
      inputSchema: {
        type: 'object',
        properties: {
          connectionId: {
            type: 'string',
            description: 'The ID or name of the DBeaver connection',
          },
          tableName: {
            type: 'string',
            description: 'Name of the table to drop',
          },
          confirm: {
            type: 'boolean',
            description: 'Safety confirmation flag (must be true)',
          },
        },
        required: ['connectionId', 'tableName', 'confirm'],
      },
    },
  • src/index.ts:512-517 (registration)
    Switch case in CallToolRequestSchema handler that dispatches to the handleDropTable method based on tool name.
    case 'drop_table':
      return await this.handleDropTable(args as { 
        connectionId: string; 
        tableName: string; 
        confirm: boolean 
      });
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the destructive nature ('Remove') and safety confirmation requirement, which is valuable. However, it doesn't mention permissions needed, whether the operation is reversible, or what happens to dependent objects, leaving 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. Every word earns its place - 'Remove' (action), 'table from the database' (resource), 'with safety confirmation' (key constraint). No wasted words.

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?

For a destructive operation with no annotations and no output schema, the description is adequate but incomplete. It covers the safety confirmation requirement but doesn't address what happens after table removal, error conditions, or return values. Given the high-stakes nature of table deletion, more context would be helpful.

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?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds marginal value by emphasizing the safety confirmation aspect, but doesn't provide additional semantic context beyond what's already in the parameter descriptions.

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

Purpose5/5

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

The description clearly states the specific action ('Remove') and target resource ('a table from the database'), distinguishing it from sibling tools like create_table or alter_table. It goes beyond the tool name by specifying the safety confirmation aspect.

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

Usage Guidelines4/5

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

The description implies this tool should be used for table deletion operations, but doesn't explicitly state when to use it versus alternatives like execute_query (which might also drop tables). It provides clear context about safety confirmation but lacks explicit exclusions or comparison to siblings.

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