"description":"Analyzes and explains the execution plan for a SQL query to help optimize database performance. Provide the database environment (dev/prod) and the SQL query to analyze. Use action_type default value as explain_query.",
"description":"Extracts the DDL (Data Definition Language) for a database object. Provide the environment (dev/prod), object_type (table, view, function, etc.), object_name, and object_schema to get the creation script. Use action_type default value as extract_ddl.",
"description":"Executes a read-only SQL query safely and returns the results with performance metrics. Provide the environment (dev/prod) and the SQL query to execute. Use action_type default value as execute_query.",
"description":"Provides comprehensive query diagnostics including execution plan analysis, buffer usage, database statistics, and performance metrics. Based on enhanced diagnostics from runbooks.py. Provide the environment (dev/prod) and SQL query to analyze. Use action_type default value as enhanced_query_diagnostics.",
"inputSchema":{
"type":"object",
"properties":{
"environment":{
"type":"string"
},
"action_type":{
"type":"string",
"description":"The type of action to perform. Use 'enhanced_query_diagnostics' for this tool."
},
"query":{
"type":"string"
}
},
"required":["environment","action_type","query"]
}
},
{
"name":"performance_insights_analysis",
"description":"Provides Performance Insights-style analysis including top queries by execution time, wait events analysis, and database load metrics. Based on comprehensive diagnostics from runbooks.py. Provide the environment (dev/prod) to analyze. Use action_type default value as performance_insights_analysis.",
"inputSchema":{
"type":"object",
"properties":{
"environment":{
"type":"string"
},
"action_type":{
"type":"string",
"description":"The type of action to perform. Use 'performance_insights_analysis' for this tool."
description=os.getenv('TARGET_DESCRIPTION','Enhanced PostgreSQL database performance analysis tool with comprehensive query execution plan analysis, DDL extraction, safe read-only query execution, enhanced query diagnostics with buffer usage analysis, and Performance Insights-style metrics. Based on production-ready runbooks with deep diagnostic capabilities.'),