Skip to main content
Glama
db-conn-mcp

db-conn-mcp

table_stats

Retrieve approximate row counts and disk/index sizes per table, ordered by total size, using database statistics without table scans to plan migrations and spot size anomalies.

Instructions

Approximate row counts and disk/index sizes per table, largest first.

Uses the database's own statistics — fast, no table scans. Useful for planning migration copy order and spotting anomalies. One row per table, so the full answer may be large on a big database — ask the narrower question instead of filtering afterwards: table for one table (optionally schema-qualified), min_size_bytes to skip anything smaller, limit for the top N by total size. With limit set the result carries truncated: true when more tables matched than were returned.

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": {
      "database": "<database>"
    },
    "name": "table_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
tableNo
databaseYes
min_size_bytesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that counts are approximate, that it avoids table scans ('fast'), that it returns one row per table and may be large on big databases, and that `limit` triggers a `truncated: true` marker. It does not discuss permissions/read-only status or output column layout, leaving a modest gap.

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 output definition, then value proposition, then per-parameter narrowing advice. Dense but every clause carries information; only the 'one row per table, so the full answer may be large' sentence slightly overlaps with the `limit`/`truncated` explanation.

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?

No output schema exists, but the description conveys the return shape (one row per table, ordered largest first, includes row counts plus disk and index sizes, carries `truncated` when limited), which is what an agent needs to interpret results. Exact column names and default ordering semantics are the only meaningful omissions for a four-parameter read tool.

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 description coverage is 0%, so the description must compensate, and it does for three of four parameters: `table` (optionally schema-qualified), `min_size_bytes` (skip anything smaller, implying a size threshold rather than a row count), and `limit` (top N by total size, with truncation signaling). The required `database` parameter is never explained, though its meaning is largely self-evident.

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 resource and output shape: 'Approximate row counts and disk/index sizes per table, largest first.' This clearly separates it from schema-oriented siblings (get_table_schema, list_tables) and row-content siblings (sample_table_rows), and notes the data source is the database's own statistics rather than a scan.

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?

Gives concrete use cases ('planning migration copy order and spotting anomalies') and prescribes how to narrow the question with `table`, `min_size_bytes`, and `limit` rather than filtering after the fact. It stops short of naming an alternative sibling or stating when not to use it, so it is clear context rather than a full routing rule.

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