Recommend read your writes
recommend_read_your_writesDetermine whether to use WAIT FOR LSN for read-your-writes consistency by combining server role, replay lag, and PostgreSQL version into an actionable recommendation.
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()
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": "recommend_read_your_writes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detail | Yes | ||
| reason | Yes | ||
| recommend_use | Yes | ||
| is_in_recovery | Yes | ||
| current_lag_bytes | Yes | ||
| server_version_num | Yes |