Skip to main content
Glama
r69shabh

pg-bloat-detective

bloat_check

Diagnose PostgreSQL bloat from a read-only timeline file, returning per-table and per-index verdicts with evidence and actionable fixes.

Instructions

Diagnose PostgreSQL bloat from a collected timeline.

Read-only: only reads the local SQLite timeline file, never touches Postgres. Args: db: Path to the SQLite timeline file (default: BLOAT_DB env, 'timeline.db'). Collect one first with bloat_collect, or pass any timeline.db path. Returns: findings: list of {table, verdict, evidence, action} — verdict is one of normal | vacuum-starved | blocked-by-idle-xact | blocked-by-slot | blocked-by-prepared | blocked-by-active-xact | needs-rewrite | index-bloated | index-unused. Evidence carries dead/live counts, pgstattuple approx %, pgstatindex %, blocker pid+query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.6

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well: it explicitly declares read-only behavior and that it never touches Postgres, only the local SQLite timeline. It also enumerates the verdict taxonomy and what evidence contains, though it omits any permission or file-access caveats.

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 and the read-only guarantee before the Args/Returns blocks, so a scanning agent gets the essentials immediately. The explicit verdict enumeration is long but earns its place by defining the output vocabulary.

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 output schema exists, so the Returns section is doing real work: it names the findings list, the per-item shape {table, verdict, evidence, action}, the full verdict enum, and what evidence carries. Combined with the documented single param, nothing needed to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the single param is titled only 'Db', so the description must compensate — and it does, documenting that db is a path to the SQLite timeline file with a BLOAT_DB env fallback and a 'timeline.db' default, plus how to obtain it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (diagnose) and resource (PostgreSQL bloat) plus the input source (a collected timeline), which implicitly separates it from bloat_live_diagnose. It names bloat_collect as the producer of its input, though it never explicitly contrasts itself with the other bloat_* siblings.

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?

Clear context is given: run bloat_collect first to obtain a timeline, or pass any timeline.db path, and the read-only/offline nature is stated. It stops short of saying when to prefer this over bloat_live_diagnose or bloat_blockers, so the sibling routing is only implied.

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