Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Get PG 19 stats status

get_pg19_stats_status
Read-only

Check whether PostgreSQL 19's pg_stat_lock and pg_stat_recovery views are usable on the server, returning availability status, version details, and diagnostic guidance.

Instructions

Report whether PG 19's pg_stat_lock and pg_stat_recovery views are usable on this server. Never raises — driver-level errors surface as available=false. On PG < 19 returns available=false with a diagnostic pointing the agent at find_blocking_chains / pg_stat_replication. Returns an object with available (bool), server_version_num (int), server_version, has_pg_stat_lock (bool), has_pg_stat_recovery (bool), and detail (guidance string).

Example: get_pg19_stats_status()

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailYes
availableYes
server_versionYes
has_pg_stat_lockYes
server_version_numYes
has_pg_stat_recoveryYes
Behavior4/5

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

Annotations already indicate read-only and self-contained behavior. The description adds valuable behavioral details: it never raises errors (surfacing driver errors as available=false) and returns specific fields including a diagnostic string. This goes beyond annotations to clarify error handling and output structure.

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?

The description is concise and well-structured, with the purpose stated upfront. The example at the end is slightly redundant but not harmful. Every sentence earns its place, and the length is appropriate for the tool's simplicity.

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

Completeness5/5

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

Given the output schema exists, the description still covers essential aspects: purpose, error behavior, version-specific behavior, and return field names. For a simple status check tool, this is fully complete and leaves no significant gaps.

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

Parameters3/5

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

The parameter 'database' has 100% schema description coverage, so the description does not need to add meaning. The tool description does not mention the parameter at all, providing no additional semantic value beyond the schema. Baseline score of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the tool reports whether PG 19's views are usable, with specific verb and resource. However, it does not explicitly differentiate from sibling tools like read_pg_stat_lock, which might lead to confusion about when to use this versus the read tools.

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

Usage Guidelines3/5

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

The description provides some usage context by mentioning behavior on PG < 19 and pointing to alternatives like find_blocking_chains. However, it does not explicitly state when to use this tool (e.g., before calling read_pg_stat_lock) or provide clear exclusions, leaving ambiguity.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/devopam/MCPg'

If you have feedback or need assistance with the MCP directory API, please join our Discord server