Skip to main content
Glama
r69shabh

pg-bloat-detective

bloat_live_diagnose

Diagnose live Postgres table and index bloat from production DSNs using a read-only temp snapshot. Returns findings, blockers, and fixes without altering stored timeline data.

Instructions

One-shot live diagnosis without touching your timeline file.

Snapshots into a throwaway temp DB, diagnoses, discards it. Read-only on Postgres (read-only tx, 5s timeout). Safest option for prod DSNs. Args: dsn: Postgres DSN (default: BLOAT_DSN env). Password never logged. Returns: {findings: [...with action], blockers: [...]} — same verdict set as bloat_check, plus the current xmin-holder evidence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dsnNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.6

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: read-only transaction, 5s timeout, temp DB created and discarded, password never logged, and no mutation of the timeline file. These are exactly the safety facts an agent needs before pointing it at a production DSN.

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?

Front-loaded with the one-line purpose, then dense supporting detail. The explicit Args:/Returns: blocks are slightly redundant given the structured schema, but every line still carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No annotations or output schema, yet the description still documents the return shape ({findings, blockers}) and how it relates to bloat_check's output. Nothing an agent needs to invoke this safely is missing.

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% (bare string with no description), so the description compensates by explaining dsn is a Postgres DSN with a BLOAT_DSN env-var default and a no-logging guarantee. Only one low-complexity parameter keeps this from being richer.

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 ('one-shot live diagnosis') and pins down its mechanism (snapshot into throwaway temp DB). Differentiates from siblings by naming bloat_check's verdict set plus added xmin-holder evidence, and from bloat_timeline by not touching the timeline file.

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?

'Safest option for prod DSNs' gives clear context for selecting this over siblings, and the no-timeline-touch note implies the timeline-based alternative. It stops short of explicit when-not conditions or naming bloat_check/bloat_timeline with a routing rule.

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