Skip to main content
Glama

detect_query_bottlenecks

Identify and analyze database query performance issues to optimize SQL Server execution efficiency and resolve bottlenecks.

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

  • The main handler function for the 'detect_query_bottlenecks' tool. It calls the BottleneckDetector and formats 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); } }
  • index.js:338-341 (registration)
    Registration and dispatch case in the tool call handler switch statement.
    case 'detect_query_bottlenecks': return { content: await this.detectQueryBottlenecks(args.database) };
  • Tool definition including name, description, and input schema. Used by getAllTools() for dynamic registration.
    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'] } } } },
  • The delegated detection method in BottleneckDetector class, currently a placeholder that returns empty array.
    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