Skip to main content
Glama
call518

MCP PostgreSQL Operations

by call518

get_database_stats

Retrieves PostgreSQL database-wide statistics, including transaction counts, block I/O, tuple operations, temp files, deadlocks, and checksum failures for performance analysis.

Instructions

[Tool Purpose]: Get comprehensive database-wide statistics and performance metrics

[Exact Functionality]:

  • Show database-wide transaction statistics (commits, rollbacks)

  • Display block I/O statistics (disk reads vs buffer hits)

  • Provide tuple operation statistics (returned, fetched, inserted, updated, deleted)

  • Show temporary file usage and deadlock counts

  • Include checksum failure information and I/O timing data

[Required Use Cases]:

  • When user requests "database statistics", "database performance", "transaction stats", etc.

  • When analyzing overall database performance and activity

  • When investigating I/O performance or buffer cache efficiency

  • When checking for deadlocks or temporary file usage

[Strictly Prohibited Use Cases]:

  • Requests for statistics reset or modification

  • Requests for database configuration changes

  • Requests for performance tuning actions

Returns: Comprehensive database statistics including transactions, I/O, tuples, and performance metrics

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv3.4.2
    • addedInput schema / additionalProperties
      Added value: +false
    • removedOutput schema / properties / result / title
      Removed value: -"Result"
    • removedOutput schema / title
      Removed value: -"_WrappedResult"
  2. Addedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does disclose the returned metric families and implicitly establishes read-only behavior via the prohibited-use list (no reset/modification). It stops short of stating which database instance/scope is covered, whether it aggregates across all databases, or the cost/latency of the query.

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

Conciseness3/5

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

Front-loaded with a clear purpose line and bracketed sections, but the '[Exact Functionality]' bullet list is substantially restated by the closing 'Returns:' paragraph, so several sentences do not earn their place. The header scaffolding is heavier than the content requires.

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?

An output schema exists, so return values need no further explanation, and with zero parameters and no annotations the remaining burden is modest. The one real gap is scope ambiguity: it never says whether 'database-wide' means the connected database only or all databases, which matters given the get_database_list and get_current_database_info siblings.

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?

The tool takes zero parameters, so the baseline is 4; there is no parameter semantics to add and the description correctly does not invent any. Schema coverage is 100% for the empty object, leaving nothing unaddressed.

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 ('Get comprehensive database-wide statistics and performance metrics') and enumerates the exact statistic families returned (transactions, block I/O, tuples, temp files, deadlocks, checksums, I/O timing). The scope word 'database-wide' distinguishes it from the many per-table, per-index, and per-backend I/O siblings in the tool list.

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 explicit '[Required Use Cases]' with trigger phrases ('database statistics', 'transaction stats') and an explicit '[Strictly Prohibited Use Cases]' section excluding reset, configuration change, and tuning requests. This is the when/when-not pattern at full strength, though it never names a specific sibling as the alternative.

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