Skip to main content
Glama
thhart

database-mcp

by thhart

profile

Retrieve column statistics from pg_stats without scanning tables: null fraction, distinct counts, common values, histogram bounds, and correlation. Analyze data distribution without running exploratory queries.

Instructions

Column statistics from pg_stats WITHOUT touching the table: null fraction, distinct count (negative = fraction of rows, -1 = unique), most common values with frequencies, histogram bounds, physical correlation. Replaces exploratory SELECT DISTINCT / GROUP BY scans.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes
profileNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description must carry the full behavioral burden. It clearly states the tool does not touch the table (read-only) and explains the negative distinct count semantics (-1 = unique). It does not mention prerequisites like permissions or staleness of pg_stats, but the behavioral core is well disclosed. This goes beyond a bare statement.

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 dense sentences, no fluff, and the primary purpose is front-loaded. The parenthetical clarification on distinct count is efficient and useful. Every word earns its place.

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

Completeness3/5

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

The output schema exists, so return format is covered. However, parameter semantics are entirely missing, and usage guidance lacks exclusions or mentions of related profile-manipulation tools. Given the tool's moderate complexity, this is an adequate but incomplete definition.

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

Parameters1/5

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

Schema description coverage is 0%, and the description provides no explanation of the two parameters. 'table' is obvious but 'profile' is unexplained (what it does, why optional, default null). Since the schema carries no descriptions, the description should compensate, but it does not. This is a significant gap.

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 states a specific action (retrieve column statistics) and the resource (pg_stats) without touching the table, and enumerates exact data points (null fraction, distinct count, MCV, histogram, correlation). It clearly distinguishes itself from generic query/describe tools by emphasizing the read-only, stats-focused purpose and explicitly replaces exploratory SELECT DISTINCT/GROUP BY scans.

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 a clear use case: replacing exploratory scans for column statistics. However, it does not explicitly state when not to use it or name sibling alternatives like describe or profile_add/remove. The context is clear but exclusions are absent, so a 4 is appropriate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thhart/database-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server