Skip to main content
Glama
igorolv

jdbc-mcp-server

tableStats

tableStats
Read-onlyIdempotent

Inspect table size and activity statistics, including row estimates, storage, dead tuples, maintenance times, and scan counters.

Instructions

Inspect operational size and activity statistics for one known table: estimated/live rows, storage, dead tuples, maintenance times and scan counters. For fields, keys and constraints, use describeTable; available statistics depend on engine and privileges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes
schemaNo
connectionYesDatabase to run against. Call listConnections for valid names; do not guess.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoError encountered while loading table statistics; other fields may be partial when set.
foundYesTrue when the requested object or path was found.
tableNo
blocksNoEngine-reported allocated block count, when available.
schemaNo
tupDelNoNumber of deleted tuples recorded by engine statistics.
tupInsNoNumber of inserted tuples recorded by engine statistics.
tupUpdNoNumber of updated tuples recorded by engine statistics.
idxScanNoNumber of index scans recorded for the table.
relkindNoEngine-specific relation kind for the table or view.
seqScanNoNumber of sequential scans recorded for the table.
avgRowLenNoAverage row length reported by optimizer statistics, when available.
temporaryNoWhether the table is temporary, when the engine reports it.
userStatsNoOracle flag indicating whether user-defined statistics are present.
chainCountNoOracle chained row count, when available.
createDateNoSQL Server object creation timestamp, when available.
deadTuplesNoEstimated number of dead tuples or obsolete row versions.
lastVacuumNoTimestamp of the last manual vacuum, when available.
liveTuplesNoEstimated number of live tuples or rows.
modifyDateNoSQL Server object modification timestamp, when available.
sampleSizeNoSample size used for optimizer statistics, when available.
seqTupReadNoNumber of tuples read by sequential scans.
compressionNoCompression setting reported for the table, when available.
emptyBlocksNoEngine-reported empty block count, when available.
globalStatsNoOracle flag indicating whether global statistics are present.
idxTupFetchNoNumber of table tuples fetched through this index, when available.
isFiletableNoSQL Server flag indicating a FileTable.
lastAnalyzeNoTimestamp of the last manual analyze/statistics collection, when available.
partitionedNoWhether the table is partitioned, when the engine reports it.
deadTuplePctNoApproximate percentage of dead tuples among total tuples.
lastAnalyzedNoTimestamp when database optimizer statistics were last collected, when available.
segmentBytesNoOracle segment size in bytes, when segment metadata is accessible.
estimatedRowsNoPlanner or catalog estimate of rows for this object or operation.
lastAutovacuumNoTimestamp of the last automatic vacuum, when available.
tableSizeBytesNoStorage used by the table heap or base data, in bytes.
toastSizeBytesNoPostgreSQL TOAST storage used by the table, in bytes.
totalSizeBytesNoTotal storage used by the table, indexes, and auxiliary storage, in bytes.
lastAutoanalyzeNoTimestamp of the last automatic analyze/statistics collection, when available.
indexesSizeBytesNoStorage used by indexes on the table, in bytes.
temporalTypeDescNoSQL Server temporal table type description.
isMemoryOptimizedNoSQL Server flag indicating a memory-optimized table.
segmentBytesErrorNoPermission or lookup error encountered while reading segment size.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds the engine/privilege dependency, which is useful context about what stats may be available. It doesn't disclose performance or error behavior, but that's less critical given the 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 sentences, no filler. The core purpose is front-loaded, and the alternative is given in a separate clause. Every part serves a purpose.

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 simple 3-parameter tool with an output schema, the description covers the essential purpose and a key caveat. It lacks explicit parameter guidance, but the schema and output schema fill in the rest. It is adequate for a well-scoped tool, though a bit more on parameter semantics would make it fully complete.

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

Parameters2/5

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

The schema has only 33% description coverage (only connection is described). The description does not elaborate on 'table', 'schema', or 'connection' beyond what their names imply. It mentions 'one known table' but doesn't explain required vs optional parameters or how to specify schema. With low schema coverage, the description should compensate but does not, leaving parameter meaning thin.

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?

The description explicitly states it inspects operational size and activity statistics for a known table, listing specific metrics (rows, storage, dead tuples, maintenance, scans). It differentiates from describeTable by noting that tool covers fields/keys/constraints, so a clear purpose and distinction from siblings is provided.

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?

It gives an explicit alternative for a different task ('For fields, keys and constraints, use describeTable'), which helps route the agent. It also cautions that stats depend on engine/privileges, implying context-dependent behavior. It doesn't mention when to prefer this over other stats tools like indexStats or columnStats, but the primary guidance is present.

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