Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

Audit settings

audit_settings
Read-only

Audit PostgreSQL configuration via pg_settings to flag dangerous toggles, cross-setting conflicts, and RAM-relative memory ratios when host RAM is supplied.

Instructions

Sanity-sweep postgresql.conf via pg_settings. Flags dangerous toggles (fsync=off, full_page_writes=off, autovacuum=off, synchronous_commit=off), cross-setting issues (maintenance_work_mem < work_mem, tiny shared_buffers, low checkpoint_completion_target), and — when total_ram_mb is supplied — RAM-relative ratios for shared_buffers / effective_cache_size (PostgreSQL can't see host RAM itself). Pure read. Returns an object with ram_aware (bool), examined_settings (list), detail, and findings (tripped rules only — each with code, setting, current, status, suggestion).

Example: audit_settings(total_ram_mb=16384)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "audit_settings"
  }
}

Input Schema

NameRequiredDescriptionDefault
databaseNoOptional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected.
total_ram_mbNo

Output Schema

NameRequiredDescriptionDefault
detailNo
findingsYes
ram_awareYes
examined_settingsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected."
  2. First observedv0.6.8

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true and openWorldHint=false; the description is consistent ('Pure read') and adds substantive context beyond them: the source of truth is `pg_settings`, host RAM is invisible to PostgreSQL hence the optional parameter, and `findings` contains only tripped rules. That is exactly the kind of behavior an agent needs to predict the outcome shape.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then rule categories, then a return-value summary and an example; almost no filler. The middle sentence is heavily parenthetical and dense, which costs a little readability, but every clause carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With annotations covering safety and an output schema covering the return object, the description only needs to cover behavior — which it does, including the optional RAM-aware mode. It omits any mention of required privileges or version dependence of the checked settings, a minor gap for a config-audit tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%: `database` is well documented in the schema, while `total_ram_mb` has no schema description. The description compensates by explaining that supplying it enables RAM-relative ratios and why (PostgreSQL cannot see host RAM), plus a worked example with 16384. Units and plausible bounds are only implied by the parameter name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: a sanity sweep of `postgresql.conf` via `pg_settings`, enumerating the exact rule classes it checks (dangerous toggles, cross-setting ratios, RAM-relative ratios). This is clearly distinct from adjacent siblings like `inspect_guc` (single setting) and `recommend_postgres_conf` (recommendations rather than pass/fail findings).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The conditional 'when `total_ram_mb` is supplied' clause makes the two invocation modes explicit, and the example shows a concrete call. It does not, however, say when to prefer this over `recommend_postgres_conf` or `check_database_health`, so the agent must infer the boundary from names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools