Skip to main content
Glama
srthkdev

DBeaver MCP Server

by srthkdev

append_insight

Add business insights and analysis notes to database memos with optional tags and connection associations for better data documentation.

Instructions

Add a business insight or analysis note to the memo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNoOptional connection ID to associate with this insight
insightYesThe business insight or analysis note to store
tagsNoOptional tags to categorize the insight

Implementation Reference

  • The main handler function for the 'append_insight' tool. Validates the input insight, creates a new BusinessInsight object with timestamp, optional connection and tags, appends it to the in-memory insights array, saves to a JSON file in tmp dir, and returns a success response with the new insight ID.
    private async handleAppendInsight(args: { insight: string; connection?: string; tags?: string[] }) {
      if (!args.insight || args.insight.trim().length === 0) {
        throw new McpError(ErrorCode.InvalidParams, 'Insight text is required');
      }
    
      const newInsight: BusinessInsight = {
        id: Date.now(),
        insight: args.insight.trim(),
        created_at: new Date().toISOString(),
        connection: args.connection,
        tags: args.tags || []
      };
    
      this.insights.push(newInsight);
      this.saveInsights();
    
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({ 
            success: true, 
            message: 'Insight added successfully',
            id: newInsight.id 
          }, null, 2),
        }],
      };
    }
  • Tool schema definition including name, description, and inputSchema with properties for insight (required string), optional connection string, and optional tags array.
    name: 'append_insight',
    description: 'Add a business insight or analysis note to the memo',
    inputSchema: {
      type: 'object',
      properties: {
        insight: {
          type: 'string',
          description: 'The business insight or analysis note to store',
        },
        connection: {
          type: 'string',
          description: 'Optional connection ID to associate with this insight',
        },
        tags: {
          type: 'array',
          items: { type: 'string' },
          description: 'Optional tags to categorize the insight',
        },
      },
      required: ['insight'],
    },
  • src/index.ts:548-553 (registration)
    Registration in the tool dispatcher switch statement within CallToolRequestSchema handler, which routes calls to the handleAppendInsight method.
    case 'append_insight':
      return await this.handleAppendInsight(args as { 
        insight: string; 
        connection?: string; 
        tags?: string[] 
      });
  • Helper method called by handleAppendInsight to persist the insights array to a JSON file in the system's tmp directory.
    private saveInsights() {
      try {
        fs.writeFileSync(this.insightsFile, JSON.stringify(this.insights, null, 2));
      } catch (error) {
        this.log(`Failed to save insights: ${error}`, 'error');
      }
    }
  • Helper method to load existing insights from the JSON file on server startup, used to initialize the insights array before handling append_insight calls.
    private loadInsights() {
      try {
        if (fs.existsSync(this.insightsFile)) {
          const data = fs.readFileSync(this.insightsFile, 'utf-8');
          this.insights = JSON.parse(data);
        }
      } catch (error) {
        this.log(`Failed to load insights: ${error}`, 'debug');
        this.insights = [];
      }
    }
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 adds insights but doesn't mention permissions needed, whether this is a write operation (implied but not explicit), potential side effects, or response format. This leaves significant gaps for a tool that likely modifies data.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core action, making it easy to parse.

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 a data addition tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., mutation effects, error handling) and doesn't explain what 'memo' means in this database context, leaving the agent with incomplete guidance.

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 schema description coverage is 100%, so the input schema already documents all parameters (connection, insight, tags) with descriptions. The tool description doesn't add any additional meaning beyond what's in the schema, such as examples or constraints, but it doesn't need to since the schema is comprehensive.

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 action ('Add') and the resource ('business insight or analysis note to the memo'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'list_insights' or 'write_query', which would require more specificity about what 'memo' refers to in this context.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't clarify if this is for adding insights to an existing memo versus creating a new one, or how it differs from 'write_query' or other data manipulation tools in the sibling list.

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