Skip to main content
Glama
srthkdev

DBeaver MCP Server

by srthkdev

create_table

Execute CREATE TABLE statements to add new database tables using existing DBeaver connections, enabling structured data storage without additional configuration.

Instructions

Create new tables in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionIdYesThe ID or name of the DBeaver connection
queryYesCREATE TABLE statement

Implementation Reference

  • The handler function that validates the CREATE TABLE query and executes it using the DBeaver client, returning success status and execution time.
    private async handleCreateTable(args: { connectionId: string; query: string }) {
      const connectionId = sanitizeConnectionId(args.connectionId);
      const query = args.query.trim();
      
      if (!query.toLowerCase().startsWith('create table')) {
        throw new McpError(ErrorCode.InvalidParams, 'Only CREATE TABLE statements are allowed');
      }
      
      const connection = await this.configParser.getConnection(connectionId);
      if (!connection) {
        throw new McpError(ErrorCode.InvalidParams, `Connection not found: ${connectionId}`);
      }
      
      const result = await this.dbeaverClient.executeQuery(connection, query);
      
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({ 
            success: true, 
            message: 'Table created successfully',
            executionTime: result.executionTime 
          }, null, 2),
        }],
      };
    }
  • Input schema defining the parameters for the create_table tool: connectionId (string) and query (string, CREATE TABLE statement).
    inputSchema: {
      type: 'object',
      properties: {
        connectionId: {
          type: 'string',
          description: 'The ID or name of the DBeaver connection',
        },
        query: {
          type: 'string',
          description: 'CREATE TABLE statement',
        },
      },
      required: ['connectionId', 'query'],
    },
  • src/index.ts:262-279 (registration)
    Tool registration in the list_tools response, including name, description, and input schema.
    {
      name: 'create_table',
      description: 'Create new tables in the database',
      inputSchema: {
        type: 'object',
        properties: {
          connectionId: {
            type: 'string',
            description: 'The ID or name of the DBeaver connection',
          },
          query: {
            type: 'string',
            description: 'CREATE TABLE statement',
          },
        },
        required: ['connectionId', 'query'],
      },
    },
  • src/index.ts:500-504 (registration)
    Dispatch in the call_tool handler switch statement that routes to the handleCreateTable function.
    case 'create_table':
      return await this.handleCreateTable(args as { 
        connectionId: string; 
        query: string; 
      });
Behavior2/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 of behavioral disclosure. It states 'Create new tables' which implies a write/mutation operation, but fails to disclose critical traits like required permissions, whether it's idempotent, error handling, or what happens on success (e.g., returns confirmation or table details). For a mutation tool with zero annotation coverage, this is a significant gap.

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 with zero wasted words. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, earning its place without unnecessary elaboration.

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 this is a mutation tool (creating tables) with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, error conditions, or behavioral nuances like side effects. For a database write operation, more context is needed to guide safe and effective use.

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 the input schema already fully documents both parameters (connectionId and query). The description adds no additional meaning beyond what's in the schema, such as query format examples or connectionId constraints. Baseline 3 is appropriate when the schema does all 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 verb ('Create') and resource ('new tables in the database'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'write_query' (which might also create tables) or 'execute_query' (which could execute CREATE TABLE statements), missing full sibling differentiation.

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 'execute_query' or 'write_query', nor does it mention prerequisites such as needing an existing connection. It lacks explicit when/when-not instructions or named alternatives, leaving usage context implied at best.

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