MCP PostgreSQL Operations
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| POSTGRES_DB | No | Default database name for connections | testdb |
| POSTGRES_HOST | No | PostgreSQL server hostname or IP address | 127.0.0.1 |
| POSTGRES_PORT | No | PostgreSQL server port number | 5432 |
| POSTGRES_USER | No | PostgreSQL connection username (needs read permissions) | postgres |
| POSTGRES_PASSWORD | Yes | PostgreSQL user password (supports special characters) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Server capabilities have not been inspected yet.
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_lock_monitoringA | [Tool Purpose]: Monitor current locks and potential deadlocks in PostgreSQL [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to analyze (uses default database if omitted) granted: Filter by granted status ("true" or "false") state: Filter by session state ("active", "idle", "idle in transaction", etc.) mode: Filter by lock mode ("AccessShareLock", "ExclusiveLock", etc.) locktype: Filter by lock type ("relation", "transactionid", "virtualxid", etc.) username: Filter by specific username Returns: Table-format information showing PID, user, database, lock type, relation, mode, granted, waiting, and blocked-by info |
| get_wal_statusA | [Tool Purpose]: Monitor WAL (Write Ahead Log) status and statistics [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: WAL status information including current LSN, WAL files, archiving status, and statistics |
| get_replication_statusA | [Tool Purpose]: Monitor PostgreSQL replication status and statistics [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: Replication status including connections, lag information, slots, and statistics |
| get_server_infoA | [Tool Purpose]: Check basic information and connection status of PostgreSQL server [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: Comprehensive information including server version, connection info, and extension status |
| get_current_database_infoA | [Tool Purpose]: Get information about the current database connection [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Target database to get info for (uses default connection if omitted) Returns: Current database name and related information for connection clarity |
| get_database_listA | [Tool Purpose]: Retrieve list of all databases and their basic information on PostgreSQL server [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: Table-format information including database name, owner, encoding, size, and connection limit |
| get_table_listA | [Tool Purpose]: Retrieve list of all tables and their information from specified database (or current DB) [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to query (uses currently connected database if omitted) Returns: Table-format information including table name, schema, owner, type, and size |
| get_user_listA | [Tool Purpose]: Retrieve list of all user accounts and permission information on PostgreSQL server [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: Table-format information including username, superuser status, permissions, and account status |
| get_table_schema_infoA | [Tool Purpose]: Retrieve detailed schema information for specific table or all tables in a database [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to query (REQUIRED - specify which database to analyze) table_name: Specific table name to analyze (if None, shows all tables) schema_name: Schema name to search in (default: "public") Returns: Detailed table schema information including columns, constraints, and metadata |
| get_database_schema_infoA | [Tool Purpose]: Retrieve detailed information about database schemas (namespaces) and their contents [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to query (REQUIRED - specify which database to analyze) schema_name: Specific schema name to analyze (if None, shows all schemas) Returns: Detailed database schema information including objects, sizes, and permissions |
| get_table_relationshipsA | [Tool Purpose]: Analyze table relationships including foreign keys, dependencies, and inheritance [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to query (REQUIRED - specify which database to analyze) table_name: Specific table name to analyze (if None, shows database-wide relationship overview) schema_name: Schema name to search in (default: "public") relationship_type: Type of relationships to show ("all", "foreign_keys", "dependencies", "inheritance") Returns: Detailed relationship information including foreign keys, dependencies, and metadata |
| get_active_connectionsA | [Tool Purpose]: Retrieve all active connections and session information on current PostgreSQL server [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: Information including PID, username, database name, client address, status, and current query |
| get_pg_stat_statements_top_queriesA | [Tool Purpose]: Analyze top queries that consumed the most time using pg_stat_statements extension [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: limit: Number of top queries to retrieve (default: 20, max: 100) database_name: Database name to analyze (uses default database if omitted) Returns: Performance statistics including query text, call count, total execution time, average execution time, and cache hit rate |
| get_pg_stat_monitor_recent_queriesA | [Tool Purpose]: Analyze recently executed queries and detailed monitoring information using pg_stat_monitor extension [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: limit: Number of recent queries to retrieve (default: 20, max: 100) database_name: Database name to analyze (uses default database if omitted) Returns: Detailed monitoring information including query text, execution statistics, client info, and bucket time |
| get_database_size_infoA | [Tool Purpose]: Analyze size information and storage usage status of all databases in PostgreSQL server [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: Table-format information with database names and size information sorted by size |
| get_table_size_infoA | [Tool Purpose]: Analyze size information and index usage of all tables in specified schema [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: schema_name: Schema name to analyze (default: "public") database_name: Database name to analyze (uses default database if omitted) Returns: Information sorted by size including table name, table size, index size, and total size |
| get_postgresql_configA | [Tool Purpose]: Retrieve and analyze PostgreSQL server configuration parameter values [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: config_name: Specific configuration parameter name to retrieve (shows all configs if omitted) filter_text: Text to filter configuration names or descriptions (optional) Returns: Configuration information including parameter name, current value, unit, description, and changeability |
| get_index_usage_statsA | [Tool Purpose]: Analyze usage rate and performance statistics of all indexes in database [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to analyze (uses default database if omitted) Returns: Index usage statistics including schema, table, index name, scans, and tuples read |
| get_vacuum_analyze_statsA | [Tool Purpose]: Analyze VACUUM and ANALYZE execution history and statistics per table [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to analyze (uses default database if omitted) Returns: Schema name, table name, last VACUUM time, last ANALYZE time, and execution count statistics |
| get_table_bloat_analysisA | [Tool Purpose]: Analyze table bloat based on dead tuple statistics and size information [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Target database name (uses default database from POSTGRES_DB env var if omitted) schema_name: Schema to analyze (analyzes all user schemas if omitted) table_pattern: Table name pattern to filter (SQL LIKE pattern, e.g., 'user%', '%log%', 'temp_*') min_dead_tuples: Minimum dead tuples to include in results (default: 1, shows all tables with any bloat) limit: Maximum number of results to return (1-100, default: 20) Returns: Table bloat analysis with bloat ratios, sizes, and maintenance recommendations |
| get_database_bloat_overviewA | [Tool Purpose]: Provide database-wide bloat overview and summary statistics [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Target database name (uses default database from POSTGRES_DB env var if omitted) limit: Maximum number of schemas to show (1-50, default: 10) Returns: Database-wide bloat summary by schema with totals and recommendations |
| get_autovacuum_statusA | [Tool Purpose]: Analyze autovacuum configuration and current maintenance status for tables [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Target database name (uses default database from POSTGRES_DB env var if omitted) schema_name: Schema to analyze (analyzes all user schemas if omitted) table_pattern: Table name pattern to filter (SQL LIKE pattern, e.g., 'user%', '%log%', 'temp_*') limit: Maximum number of tables to analyze (1-100, default: 50) Returns: Autovacuum configuration status with trigger analysis and maintenance recommendations |
| get_autovacuum_activityA | [Tool Purpose]: Monitor recent autovacuum and autoanalyze activity patterns and execution history [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Target database name (uses default database from POSTGRES_DB env var if omitted) schema_name: Schema to analyze (analyzes all user schemas if omitted) hours_back: Time period to analyze in hours (default: 24, max: 168 for 7 days) limit: Maximum number of tables to show (1-100, default: 50) Returns: Recent autovacuum activity analysis with patterns and timing statistics |
| get_running_vacuum_operationsA | [Tool Purpose]: Monitor currently running VACUUM and ANALYZE operations in real-time [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Target database name (shows operations in all databases if omitted) Returns: Real-time status of running VACUUM/ANALYZE operations with timing and progress information |
| get_vacuum_effectiveness_analysisA | [Tool Purpose]: Analyze VACUUM effectiveness and maintenance patterns using existing statistics [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Target database name (uses default database from POSTGRES_DB env var if omitted) schema_name: Schema to analyze (analyzes all user schemas if omitted) limit: Maximum number of tables to analyze (1-100, default: 30) Returns: VACUUM effectiveness analysis with maintenance patterns and recommendations |
| get_database_statsA | [Tool Purpose]: Get comprehensive database-wide statistics and performance metrics [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: Comprehensive database statistics including transactions, I/O, tuples, and performance metrics |
| get_bgwriter_statsA | [Tool Purpose]: Analyze background writer and checkpoint performance statistics with version compatibility [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Returns: Background writer and checkpoint performance statistics with version-appropriate data |
| get_io_statsA | [Tool Purpose]: Analyze comprehensive I/O statistics across all database operations with version compatibility [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: limit: Maximum number of results to return (1-100, default 20) database_name: Target database name (optional) Returns: Comprehensive I/O statistics with version-appropriate detail level |
| get_table_io_statsA | [Tool Purpose]: Analyze I/O performance statistics for tables (disk reads vs buffer cache hits) [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to analyze (uses default database if omitted) schema_name: Schema name to filter (default: public) Returns: Table I/O statistics including heap, index, and TOAST performance metrics |
| get_index_io_statsA | [Tool Purpose]: Analyze I/O performance statistics for indexes (disk reads vs buffer cache hits) [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to analyze (uses default database if omitted) schema_name: Schema name to filter (default: public) Returns: Index I/O statistics including buffer hit ratios and performance metrics |
| get_all_tables_statsA | [Tool Purpose]: Get comprehensive statistics for all tables (including system tables if requested) [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to analyze (uses default database if omitted) include_system: Include system tables in results (default: False) Returns: Comprehensive table statistics including access patterns and maintenance history |
| get_user_functions_statsA | [Tool Purpose]: Analyze performance statistics for user-defined functions [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to analyze (uses default database if omitted) Returns: User-defined function performance statistics including call counts and timing |
| get_database_conflicts_statsA | [Tool Purpose]: Analyze query conflicts in standby/replica database environments [Exact Functionality]:
[Required Use Cases]:
[Strictly Prohibited Use Cases]:
Args: database_name: Database name to analyze (uses default database if omitted) Returns: Database conflict statistics (meaningful only on standby servers) |
| get_prompt_templateB | Returns the MCP prompt template (full, headings, or specific section). Args: section: Section number or keyword (optional) mode: 'full', 'headings', or None (optional) |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| prompt_template_full | Return the full canonical prompt template. |
| prompt_template_headings | Return compact list of section headings. |
| prompt_template_section | Return a specific prompt template section by number or keyword. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 34 tools
The tools have clear descriptions but significant overlap exists in monitoring areas. For example, get_autovacuum_activity, get_autovacuum_status, get_vacuum_analyze_stats, and get_vacuum_effectiveness_analysis all focus on vacuum operations with subtle distinctions that could confuse agents. Similarly, multiple I/O and statistics tools (get_io_stats, get_table_io_stats, get_index_io_stats, get_database_stats) have overlapping purposes despite targeting different objects.
All tools follow a consistent verb_noun pattern with 'get_' prefix, making them predictable and readable. The naming convention is uniformly applied across all 34 tools, with clear descriptive names that indicate their purpose (e.g., get_table_bloat_analysis, get_replication_status).
34 tools is excessive for a PostgreSQL monitoring server, creating cognitive overload. While PostgreSQL has many monitoring aspects, the tool set feels bloated with redundant tools (e.g., four vacuum-related tools) and could be consolidated. A more focused set of 15-20 tools would better serve the domain.
The tool set provides comprehensive monitoring coverage for PostgreSQL administration, including connections, performance, replication, vacuum, bloat, and configuration. Minor gaps exist in areas like session management (e.g., no tool for session termination) and real-time query execution, but core monitoring workflows are well-covered.