Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
POSTGRES_URLYesPostgreSQL connection URL, e.g. postgresql://mcp_readonly:PASSWORD@localhost:5432/app.
POSTGRES_MODENoAccess mode: read-only, read-write, or admin. Tools above the mode are never registered.read-only
POSTGRES_DRY_RUNNoWhen true, write and admin tools validate and log intent, then return without touching the database.false
POSTGRES_MAX_ROWSNoMaximum rows returned to the model per call.200
POSTGRES_AUDIT_LOGNoWhen true, emits a JSON audit line to stderr per guarded operation.true
POSTGRES_GUARD_MODENoOptional laya-guard check mode for mutating calls: off, monitor, or enforce. It can only add a confirmation or block, never grant.off
POSTGRES_ALLOW_DELETENoWhether delete_rows, drop_table, and terminate_backend are allowed. Requires admin mode and this flag.false
POSTGRES_ALLOW_RAW_SQLNoWhether execute_sql may be registered. Requires admin mode and this flag.false
POSTGRES_ALLOW_SUPERUSERNoWhether superuser connections are allowed. Connecting as a superuser is refused by default.false
POSTGRES_SCHEMA_ALLOWLISTNoWhen set, schemas outside the allowlist are refused, and free-form SQL tools such as run_query, explain_query, and execute_sql are refused.
POSTGRES_MAX_AFFECTED_ROWSNoMaximum rows an insert, update, or delete may affect; operations touching more rows are rolled back.1000
POSTGRES_PROTECTED_SCHEMASNoAdditional schemas that are read-only forever.
POSTGRES_STATEMENT_TIMEOUT_MSNoStatement timeout in milliseconds applied to every statement the server runs.15000
POSTGRES_REDACT_SECRET_COLUMNSNoWhen true, secret-like column values are replaced with [REDACTED], and inline passwords and connection strings in errors are masked.true
POSTGRES_PROTECT_SYSTEM_SCHEMASNoWhen true, system schemas such as pg_catalog, information_schema, pg_toast, and pg_* can be read but never mutated.true
POSTGRES_REQUIRE_HUMAN_APPROVALNoWhen true, destructive operations are refused if the client cannot elicit human approval.false

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

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_server_infoA

PostgreSQL version, current database and role, database size, uptime, and whether it is a replica.

list_schemasA

List schemas with owner and relation count (filtered to POSTGRES_SCHEMA_ALLOWLIST when set).

list_tablesA

List tables, views, and materialized views with estimated row counts and on-disk size.

describe_tableC

Columns (type, nullability, default), constraints, indexes (with scan counts), size, and estimated rows.

select_rowsA

Read rows from one table with equality filters — no SQL needed, and held to the schema allowlist. Results are capped at POSTGRES_MAX_ROWS; secret-like columns are redacted.

run_queryA

Run one SELECT / WITH / VALUES / TABLE / SHOW statement inside a READ ONLY transaction that is always rolled back. Use $1, $2 … placeholders with params for values. Results are capped at POSTGRES_MAX_ROWS. Refused while POSTGRES_SCHEMA_ALLOWLIST is set (free-form SQL can reach any schema) — use select_rows then.

explain_queryA

Show the planner's JSON plan for one statement (SELECT/WITH/VALUES/TABLE, or INSERT/UPDATE/DELETE/MERGE — not executed). analyze: true executes read statements inside a rolled-back READ ONLY transaction for real timings. Refused while POSTGRES_SCHEMA_ALLOWLIST is set.

list_active_queriesB

Sessions from pg_stat_activity: role, state, wait event, transaction/query age, and query text (inline secrets masked).

get_database_statsB

Connections by state, commits/rollbacks, deadlocks, temp usage, cache hit ratio, and key memory settings.

get_top_queriesA

Most expensive statements from pg_stat_statements (requires the extension), with inline secrets masked.

list_rolesA

Roles with their attributes (superuser, login, replication, bypass RLS …) and memberships. Never returns passwords.

list_extensionsB

Installed extensions with their version, schema, and the newest available version.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.7/5.0

Scored across 12 tools

Disambiguation4/5

Most tools target clearly distinct subjects (table structure, schemas, sessions, roles, extensions, planner output). The only real overlaps are select_rows vs run_query and get_server_info vs get_database_stats, but the descriptions explicitly spell out the boundary (allowlist-safe row reads vs free-form read-only SQL) well enough that an agent can choose correctly.

Naming Consistency5/5

Every tool follows a predictable verb_noun snake_case pattern (describe_table, list_schemas, get_server_info, select_rows, run_query, explain_query). Verbs are used consistently by semantic class: list_* for enumerations, get_* for aggregate snapshots, describe_* for structure.

Tool Count5/5

Twelve tools sit in the sweet spot for a database inspection server, with no filler — introspection, data access, planning, and performance/ops views each contribute distinct capability. Nothing obviously redundant or missing at this granularity.

Completeness4/5

The read-only diagnostic lifecycle is well covered: schema discovery, structural detail, row sampling, ad-hoc querying, plan analysis, live/aggregated query stats, roles, and extensions. Minor gaps remain — no way to enumerate functions, triggers, sequences, or view definitions, and no object-name search — but agents can fall back to run_query/describe_table for most of these.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues