Skip to main content
Glama
call518

MCP PostgreSQL Operations

by call518

get_database_conflicts_stats

Retrieve query conflict statistics by type on standby or replica databases to diagnose replication lag and performance issues.

Instructions

[Tool Purpose]: Analyze query conflicts in standby/replica database environments

[Exact Functionality]:

  • Show conflict statistics for standby servers (only relevant on replicas)

  • Display conflicts by type (tablespace, lock, snapshot, bufferpin, deadlock)

  • Help diagnose replication-related performance issues

  • Provide conflict resolution statistics

[Required Use Cases]:

  • When user requests "replication conflicts", "standby conflicts", etc.

  • When analyzing replica server performance issues

  • When troubleshooting replication lag or conflicts

  • When monitoring standby server health

[Strictly Prohibited Use Cases]:

  • Requests for conflict resolution actions

  • Requests for replication configuration changes

  • Requests for statistics reset

Input Schema

NameRequiredDescriptionDefault
database_nameNoDatabase name to analyze (uses default database if omitted)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.4.3
    • addedInput schema / properties / database_name / description
      Added value: +"Database name to analyze (uses default database if omitted)"
  2. Changed6 schema fields changedv3.4.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / database_name / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / database_name / title
      Removed value: -"Database Name"
    • removedInput schema / properties / database_name / type
      Removed value: -"string"
    • removedOutput schema / properties / result / title
      Removed value: -"Result"
    • removedOutput schema / title
      Removed value: -"_WrappedResult"
  3. Addedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

No annotations, so the description carries the burden: verbs like "Show/Display/Provide" plus the prohibition on resolution actions and statistics reset signal a purely read-only, side-effect-free diagnostic. It also discloses the key constraint that it is only relevant on replicas. It does not mention permission requirements, but that is minor for a stats-read tool.

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?

Bracketed section headers front-load purpose and functionality before use cases, making it easy to scan. Slightly verbose with some overlap between "Exact Functionality" and "Required Use Cases", but no sentence is truly wasted.

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 an output schema present, return values need not be explained, and the single optional parameter is documented in the schema. The description covers use cases, exclusions, and the replica-only constraint, leaving only minor gaps around permissions/limits.

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?

One optional parameter with 100% schema description coverage, so the schema already explains database_name and its default behavior. The description adds no format or selection guidance beyond what the schema states, so baseline 3 applies.

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+resource ("Analyze query conflicts") and scopes it to standby/replica environments, which cleanly separates it from siblings like get_replication_status or get_wal_status. The enumerated conflict types (tablespace, lock, snapshot, bufferpin, deadlock) make the resource concrete.

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

Usage Guidelines5/5

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

Provides both positive triggers ("replication conflicts", "standby conflicts", replica performance troubleshooting) and a strictly prohibited list (conflict resolution actions, replication configuration changes, statistics reset). The agent knows exactly when to select this tool and when not to.

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