Skip to main content
Glama

get_index_recommendations

Analyze database performance and generate index recommendations to optimize SQL Server queries and improve execution efficiency.

Instructions

Get index recommendations for database optimization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (optional)
schemaNoSchema name (optional, defaults to dbo)
limitNoMaximum number of recommendations to return (optional, defaults to 10)
impact_thresholdNoMinimum impact score threshold (0-100, optional)

Implementation Reference

  • Primary handler for the get_index_recommendations tool. Delegates to QueryOptimizer.analyzeIndexUsage and formats JSON response.
    async getIndexRecommendations(database) { try { const recommendations = await this.queryOptimizer.analyzeIndexUsage(database); return [ { type: 'text', text: JSON.stringify( { success: true, data: recommendations }, null, 2 ) } ]; } catch (error) { throw new McpError(ErrorCode.InternalError, error.message); } }
  • Core implementation logic for generating index recommendations (placeholder implementation). Called by main handler.
    async analyzeIndexUsage(database) { // Basic index recommendations - this would normally query SQL Server DMVs return { database, timestamp: new Date().toISOString(), recommendations: [ { type: 'missing_index', priority: 'high', suggestion: 'Consider adding indexes on frequently queried columns', impact: 'Could improve query performance by 50-80%', table: 'example_table', columns: ['column1', 'column2'] } ], unusedIndexes: [], duplicateIndexes: [], fragmentedIndexes: [] }; }
  • Tool definition with name, description, and input schema used for MCP tool listing and validation.
    name: 'get_index_recommendations', description: 'Get index recommendations for database optimization', inputSchema: { type: 'object', properties: { database: { type: 'string', description: 'Database name (optional)' }, schema: { type: 'string', description: 'Schema name (optional, defaults to dbo)' }, limit: { type: 'number', description: 'Maximum number of recommendations to return (optional, defaults to 10)' }, impact_threshold: { type: 'number', description: 'Minimum impact score threshold (0-100, optional)' } } } },
  • index.js:328-331 (registration)
    Dispatch case in the main tool request handler switch statement that routes to the tool handler.
    case 'get_index_recommendations': return { content: await this.getIndexRecommendations(args.database) };

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