Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Recommend read your writes

recommend_read_your_writes
Read-only

Checks PostgreSQL server role and replication lag to recommend using WAIT FOR LSN for read-your-writes consistency, ensuring up-to-date reads from standbys.

Instructions

Advise whether the caller should use WAIT FOR LSN for read-your-writes consistency. Combines server role (primary vs standby), replay lag, and PG version into a structured recommendation. Never raises. reason is one of primary_no_wait_needed, standby_no_lag, standby_lag_unknown, standby_with_lag, standby_pg18_or_older, unavailable. Returns an object with recommend_use (bool), reason, is_in_recovery, server_version_num, current_lag_bytes (int / null), and detail.

Example: recommend_read_your_writes()

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
reasonYes
recommend_useYes
is_in_recoveryYes
current_lag_bytesYes
server_version_numYes
Behavior4/5

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

The description explicitly states 'Never raises,' a behavioral guarantee not covered by readOnlyHint annotation. It also details output fields and possible reasons, providing transparency on what the agent can expect.

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

Conciseness5/5

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

The description is concise (3 sentences + example), front-loads the core purpose, and efficiently covers inputs, outputs, and behavioral guarantee. Every sentence adds value with no wasted words.

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?

The description covers purpose, inputs, outputs, possible reasons, and a behavioral guarantee. With annotations specifying read-only and open-world hint, it is nearly complete. Could explicitly mention relation to sibling 'wait_for_lsn' to enhance completeness, but otherwise adequate.

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 only parameter 'database' is fully documented in the input schema. The description does not add new semantic information about the parameter beyond what the schema provides, so baseline 3 is appropriate.

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?

Description specifies verb 'advise' and resource 'whether to use WAIT FOR LSN', clearly differentiating from sibling tools like 'wait_for_lsn' (executes wait) and 'get_current_wal_lsn' (retrieves LSN). It enumerates possible reasons and return fields, making purpose unambiguous.

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 description explains that the tool advises on using WAIT FOR LSN, implying it should be used before deciding to wait. It doesn't explicitly list when-not-to-use or alternatives, but the sibling structure and tool name make the usage context clear.

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