Skip to main content
Glama

get_optimization_insights

Analyze SQL Server database performance and health to identify optimization opportunities. Provides insights on query efficiency, resource usage, and configuration improvements.

Instructions

Get comprehensive database optimization insights and health analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (optional)
analysis_periodNoAnalysis time period: 24_HOURS, 7_DAYS, 30_DAYS (optional, defaults to 7_DAYS)

Implementation Reference

  • Defines the input schema and metadata for the get_optimization_insights tool.
    { name: 'get_optimization_insights', description: 'Get comprehensive database optimization insights and health analysis', inputSchema: { type: 'object', properties: { database: { type: 'string', description: 'Database name (optional)' }, analysis_period: { type: 'string', description: 'Analysis time period: 24_HOURS, 7_DAYS, 30_DAYS (optional, defaults to 7_DAYS)', enum: ['24_HOURS', '7_DAYS', '30_DAYS'] } } } },
  • index.js:240-242 (registration)
    Registers the tool in the MCP server's tool list via getAllTools() from tool-registry.
    // Register tools from the tool registry this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getAllTools()
  • Dispatch handler in the main tool switch statement that invokes the specific optimization insights method.
    case 'get_optimization_insights': return { content: await this.getOptimizationInsights(args.database) };
  • Primary handler method that delegates to QueryOptimizer and formats the response for MCP.
    async getOptimizationInsights(database) { try { const insights = await this.queryOptimizer.getOptimizationInsights(database); return [ { type: 'text', text: JSON.stringify( { success: true, data: insights }, null, 2 ) } ]; } catch (error) { throw new McpError(ErrorCode.InternalError, error.message); } }
  • Core QueryOptimizer implementation for getOptimizationInsights (currently a placeholder).
    async getOptimizationInsights(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 getOptimizationInsights'); } // 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