Skip to main content
Glama

get_optimization_insights

Analyze database performance and health metrics to identify optimization opportunities and improve query efficiency.

Instructions

Get comprehensive database optimization insights and health analysis

Input Schema

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

Implementation Reference

  • Tool handler method that calls queryOptimizer.getOptimizationInsights and formats the JSON 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 helper function in QueryOptimizer that provides the optimization insights logic (currently a placeholder implementation).
    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({}); }
  • Tool registration entry including name, description, and input schema.
    { 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'] } } } },
  • Dispatch handler case in the main tool request handler switch statement.
    case 'get_optimization_insights': return { content: await this.getOptimizationInsights(args.database) };
  • Input schema definition for get_optimization_insights tool.
    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'] } } }

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