Skip to main content
Glama
call518

MCP PostgreSQL Operations

by call518

get_per_backend_io_stats

Analyze per-backend I/O and WAL statistics to identify PostgreSQL processes causing high I/O activity and diagnose process-level hotspots (PG 18+).

Instructions

[Tool Purpose]: Analyze per-backend I/O and WAL statistics (PostgreSQL 18+)

Note: Uses pg_stat_get_backend_io() and pg_stat_get_backend_wal() which are new in PG 18.

[Exact Functionality]:

  • Show I/O statistics broken down by individual backend process

  • Display per-backend WAL generation statistics

  • Identify backends with highest I/O activity

  • Falls back to version notice on PG < 18

[Required Use Cases]:

  • When user requests "per-backend I/O", "backend I/O stats", "which backend is doing most I/O"

  • When diagnosing I/O hotspots at the process level

  • When analyzing per-connection I/O patterns

[Strictly Prohibited Use Cases]:

  • Requests for backend termination

  • Requests for I/O configuration changes

Args: database_name: Database name (uses default if omitted) limit: Maximum results (1-100, default 20)

Returns: Per-backend I/O and WAL statistics, or version notice on older PG

Input Schema

NameRequiredDescriptionDefault
limitNo
database_nameNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.4.2

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the disclosure burden well: it names the PG 18+ version gate, the underlying pg_stat_get_backend_io/pg_stat_get_backend_wal functions, and states that it falls back to a version notice on older servers. It never states required privileges (e.g. pg_monitor/superuser) for these functions, and read-only behavior is only implied by the 'get' naming and Returns section.

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 make it easy to scan and the purpose/version note is front-loaded. There is some redundancy between the top-line purpose and the '[Exact Functionality]' bullets, which repeat the per-backend scoping twice, but nothing is genuinely wasteful.

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?

For a two-parameter stats tool with an output schema, the definition covers purpose, version gating, fallback behavior, invocation contexts and prohibitions. The main residual gap for a tool with zero annotations is privilege requirements, which an agent would need to know before calling it on a real server.

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?

Schema coverage is 0%, so the description must compensate, and it does: it documents both parameters and adds the 1-100 valid range and default 20 for limit, which the schema does not specify. database_name is only given as 'uses default if omitted', leaving it slightly thin, but each parameter is covered.

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 ('Analyze per-backend I/O and WAL statistics') and pins the scope to individual backend processes, which implicitly separates it from the coarser siblings get_io_stats, get_table_io_stats and get_index_io_stats. The PG 18+ qualifier and the named underlying functions make the 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 Guidelines5/5

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

Provides explicit 'Required Use Cases' with sample user phrasings and an explicit 'Strictly Prohibited Use Cases' section excluding termination and I/O configuration changes. This is exactly the when-to-use / when-not-to-use guidance the dimension asks for.

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