Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

Get hypertable stats

get_hypertable_stats
Read-only

Get size and compression stats for a TimescaleDB hypertable: chunk counts, row estimates, byte usage, and compression savings. Flags non-hypertables or missing TimescaleDB extension.

Instructions

Size and compression statistics for one TimescaleDB hypertable: total/compressed chunk counts, approximate row count, table/index/toast/total bytes, and bytes before/after compression. Errors if the table is not a hypertable; available=false when the timescaledb extension is not installed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "schema": "<schema>",
      "table": "<table>"
    },
    "name": "get_hypertable_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYes
schemaYes
databaseNoOptional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected.

Output Schema

NameRequiredDescriptionDefault
tableYes
schemaYes
availableYes
index_bytesYes
table_bytesYes
toast_bytesYes
total_bytesYes
total_chunksYes
compressed_chunksYes
approximate_row_countYes
after_compression_bytesYes
before_compression_bytesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected."
  2. Addedv0.8.3

TDQS

A4/5.0
Behavior4/5

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

Beyond the readOnlyHint, it discloses real behavioral traits: a hard error when the relation is not a hypertable, and an available=false outcome when the timescaledb extension is absent. That edge-case behavior is exactly what an agent needs and is not captured by annotations.

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

Conciseness5/5

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

Two tight sentences, front-loaded with purpose then edge cases, with zero filler. Every clause (metric list, error condition, extension-missing case) carries information.

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 and a read-only annotation, the remaining burden is edge-case behavior, which is covered (non-hypertable error, extension-missing fallback). Minor gap: no mention of cost/latency on large hypertables or what units the byte metrics use, though the output schema may cover the latter.

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?

Schema description coverage is only 33% (only 'database' is documented), but the two undocumented params (schema, table) are self-evident and the description reinforces 'one hypertable' targeting. It adds no format or resolution guidance for schema/table beyond the schema itself, so a baseline score is warranted.

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?

Names the specific verb and resource ('Size and compression statistics for one TimescaleDB hypertable') and enumerates exactly which metrics come back (chunk counts, row count, bytes, compression ratios). This clearly separates it from sibling tools like list_hypertables, list_chunks, or describe_table.

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

Usage Guidelines3/5

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

Implicitly the tool is for a hypertable already known to the caller, and the error-on-non-hypertable note hints at prerequisites, but it never states when to reach for this versus list_hypertables, list_chunks, or analyze_table_bloat. Usage is inferable rather than guided.

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

Deploy Server

Other Tools