Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DATABASE_URI | Yes | PostgreSQL connection string (Format: postgresql://user:password@host:port/database) |
Schema
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_slow_queries | Retrieve slow queries from PostgreSQL using pg_stat_statements. Returns the top N slowest queries ordered by total execution time. Requires the pg_stat_statements extension to be enabled. The results include:
|
| analyze_query | Analyze a SQL query's execution plan and performance characteristics. Uses EXPLAIN ANALYZE to execute the query and capture detailed timing information. Provides analysis of:
WARNING: This actually executes the query! For SELECT queries this is safe, but be careful with INSERT/UPDATE/DELETE - use analyze_only=false for those. |
| get_table_stats | Get detailed statistics for database tables. Returns information about:
This helps identify tables that may need maintenance (VACUUM, ANALYZE) or have performance issues. |
| get_index_recommendations | Get AI-powered index recommendations for your database. Analyzes your query workload (from pg_stat_statements) and recommends indexes that would improve performance. Uses a sophisticated analysis algorithm that:
The recommendations consider:
|
| explain_with_indexes | Run EXPLAIN on a query, optionally with hypothetical indexes. This tool allows you to see how a query would perform with proposed indexes WITHOUT actually creating them. Requires HypoPG extension for hypothetical testing. Use this to:
Returns both the original and hypothetical execution plans for comparison. |
| manage_hypothetical_indexes | Manage HypoPG hypothetical indexes for testing. HypoPG allows you to create "hypothetical" indexes that exist only in memory and can be used to test query plans without the overhead of creating real indexes. Actions:
This is useful for:
|
| find_unused_indexes | Find indexes that are not being used or are duplicates. Identifies:
Removing unused indexes can:
|
| check_database_health | Perform a comprehensive database health check. Analyzes multiple aspects of PostgreSQL health:
Returns a health score with detailed breakdown and recommendations. |
| get_active_queries | Get information about currently active queries and connections. Shows:
Useful for:
|
| analyze_wait_events | Analyze PostgreSQL wait events to identify bottlenecks. Wait events indicate what processes are waiting for:
This helps identify:
|
| review_settings | Review PostgreSQL configuration settings and get recommendations. Analyzes key performance-related settings:
Compares against best practices and system resources. |