Skip to main content
Glama

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([]); }

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