Skip to main content
Glama
egarcia74

Warp SQL Server MCP

by egarcia74

detect_query_bottlenecks

Identify and analyze database query performance issues to optimize SQL execution and improve system efficiency.

Instructions

Detect and analyze query bottlenecks in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (optional)
limitNoMaximum number of bottlenecks to return (optional, defaults to 10)
severity_filterNoFilter by severity level: LOW, MEDIUM, HIGH, CRITICAL (optional)

Implementation Reference

  • Main MCP tool handler function that executes the detect_query_bottlenecks tool by delegating to the BottleneckDetector class and formatting the response.
    async detectQueryBottlenecks(database) {
      try {
        const bottlenecks = await this.bottleneckDetector.detectBottlenecks(database);
        return [
          {
            type: 'text',
            text: JSON.stringify(
              {
                success: true,
                data: bottlenecks
              },
              null,
              2
            )
          }
        ];
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, error.message);
      }
    }
  • Input schema definition for the detect_query_bottlenecks tool, including parameters for database, limit, and severity filter.
    name: 'detect_query_bottlenecks',
    description: 'Detect and analyze query bottlenecks in the database',
    inputSchema: {
      type: 'object',
      properties: {
        database: { type: 'string', description: 'Database name (optional)' },
        limit: {
          type: 'number',
          description: 'Maximum number of bottlenecks to return (optional, defaults to 10)'
        },
        severity_filter: {
          type: 'string',
          description: 'Filter by severity level: LOW, MEDIUM, HIGH, CRITICAL (optional)',
          enum: ['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']
        }
      }
    }
  • index.js:338-341 (registration)
    Tool registration in the main request handler switch statement that routes calls to the detectQueryBottlenecks method.
    case 'detect_query_bottlenecks':
      return {
        content: await this.detectQueryBottlenecks(args.database)
      };
  • Core helper method in BottleneckDetector class that performs the actual bottleneck detection (currently a placeholder implementation). Additional helper methods like analyzeQuery, identifyBottleneckType exist in the same class for supporting logic.
    async detectBottlenecks(query) {
      const pool = this.connectionManager.getPool();
      if (!pool) {
        throw new Error('Not connected to any server');
      }
    
      if (!query) {
        throw new Error('Query is required for detectBottlenecks');
      }
    
      // Placeholder for actual implementation
      return Promise.resolve([]);
    }
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 mentions 'detect and analyze' but doesn't specify whether this is a read-only operation, if it requires special permissions, its impact on database performance, or what the analysis entails (e.g., returns a report, logs data). For a diagnostic tool with zero annotation coverage, this is a significant gap in transparency.

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 ('Detect and analyze query bottlenecks in the database') with zero wasted words. It's appropriately sized for the tool's complexity and gets straight to the point 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 the tool's diagnostic nature, no annotations, and no output schema, the description is incomplete. It doesn't cover what the tool returns (e.g., a list of bottlenecks, analysis details), behavioral aspects like performance impact, or how it differs from siblings. For a tool with 3 parameters and potential complexity, more context is needed to guide 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%, meaning all parameters are documented in the schema itself. The description adds no additional meaning beyond the schema, such as explaining how 'database' selection affects results or what 'severity_filter' implies in practice. Baseline 3 is appropriate when the schema does the heavy lifting without description enhancement.

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 with a specific verb ('detect and analyze') and resource ('query bottlenecks in the database'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'analyze_query_performance' or 'get_query_performance', which likely have overlapping functionality, so it doesn't reach the highest 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. With siblings such as 'analyze_query_performance' and 'get_query_performance' available, there's no indication of specific contexts, prerequisites, or exclusions for choosing this tool, leaving the agent to guess based on tool names 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/egarcia74/warp-sql-server-mcp'

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