Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PGSSLMODENolibpq SSL mode setting read by the PostgreSQL driver.
PGPASSFILENoPath to a .pgpass file used by the PostgreSQL driver for credentials.
PGPASSWORDNoPassword read by the PostgreSQL driver when the connection URI does not include one.
DATABASE_URIYesPostgreSQL connection string/URI. It may also be supplied as the first positional argument; when both are provided, DATABASE_URI takes precedence.
PGSERVICEFILENoPath to a pg_service.conf file used by the PostgreSQL driver for named service definitions.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

PostgreSQL tools for one database. Access mode: restricted (read-only). Tabular results are CSV with a header row; NULL is \N. In values, \n \r \t are control characters and \ is a backslash. A tsvector value is shown as [tsvector: lexemes]; select col::text to read it. The last line starts with "--" and reports row count, truncation and timing. If a result is truncated, refine the query (WHERE, LIMIT, aggregates) rather than asking for more rows. A long cell is cut and ends with …[+ chars]; execute_sql takes max_cell to read more of it. When a column holds jsonb or long text, pass max_cell on the first call: reading the same row twice costs more than one wider call.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
analyze_db_healthA

Analyzes database health. Here are the available health checks:

  • index - checks for invalid, duplicate, bloated and rarely used indexes

  • connection - checks the number of connections and their utilization

  • vacuum - checks transaction id wraparound and dead rows

  • sequence - checks sequences at risk of exceeding their maximum value

  • replication - checks replication health including lag and slots

  • buffer - checks for buffer cache hit rates for indexes and tables

  • constraint - checks for invalid constraints

  • all - runs all checks You can optionally specify a single health check or a comma-separated list of health checks. The default is 'all' checks.

analyze_locksA

Reports the lock waits in progress: which sessions are blocked, which sessions block them, through how many hops, on which lock and for how long. Read-only diagnosis of a single snapshot: it never cancels or terminates anything.

analyze_query_indexesA

Analyze a list of (up to 10) SQL queries and recommend optimal indexes

analyze_workload_indexesB

Analyze frequently executed queries in the database and recommend optimal indexes

execute_sqlA

Execute a read-only SQL query. Long cells are shortened; pass max_cell to read more. The result is also capped at 32768 bytes, whatever max_rows says; the footer says so when it is cut.

explain_queryB

Explains the execution plan for a SQL query, showing how the database will execute it and provides detailed cost estimates. Queries with $n parameters get a generic plan.

get_object_detailsC

Show detailed information about a database object

get_top_queriesA

Reports the slowest or most resource-intensive queries using data from the 'pg_stat_statements' extension. Only statements of the current database are reported.

list_objectsC

List objects in a schema

list_schemasB

List all schemas in the database

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.5/5.0

Scored across 10 tools

Disambiguation4/5

Each tool has a largely distinct purpose: locks vs. health vs. query plans vs. object listing. The main fuzzy pair is analyze_query_indexes (analyze a supplied query list) vs. analyze_workload_indexes (analyze pg_stat_statements workload), which an agent could confuse, but the descriptions make the input difference clear. get_object_details vs. list_objects/list_schemas are also adequately separated.

Naming Consistency5/5

All ten tools follow a consistent snake_case verb_noun pattern (analyze_*, get_*, list_*, execute_sql, explain_query). No mixed casing or inconsistent verb styles. The convention makes the action+resource of each tool predictable.

Tool Count5/5

Ten tools is well within the ideal 3-15 range for a DBA diagnostic server. Each tool covers a distinct diagnostic area (locks, health, indexes, execution, object introspection) with no apparent filler.

Completeness4/5

The surface covers the main read-only DBA workflows: health checks, lock analysis, slow-query inspection, plan explanation, index recommendations, and schema/object exploration. The deliberate read-only stance (no cancel/terminate, no config parameter inspection or pg_stat_activity detail dump) leaves some operational gaps, but they are minor and consistent with the server's stated scope.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues