Skip to main content
Glama
igorolv

jdbc-mcp-server

estimateSelectivity

estimateSelectivity
Read-onlyIdempotent

Estimate how selective a proposed table predicate is without running the query, returning planner-estimated rows, the unfiltered baseline, and their ratio to guide filter evaluation and composite-index column ordering.

Instructions

Estimate how selective one proposed table predicate is without executing the query. Returns planner-estimated rows, the unfiltered baseline and their ratio; use when evaluating filters or composite-index column order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes
schemaNo
predicateYesRaw boolean SQL without WHERE or ';'.
connectionYesDatabase to run against. Call listConnections for valid names; do not guess.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoAdditional context about support, limits, interpretation, or engine-specific behavior.
tableNoTable on which the predicate selectivity was estimated.
schemaNo
predicateNoRaw SQL predicate without the WHERE keyword used for selectivity estimation.
selectivityNoEstimated predicate selectivity, calculated as estimated rows divided by baseline rows.
baselineRowsNoPlanner row estimate for the table without the predicate.
estimatedRowsNoPlanner or catalog estimate of rows for this object or operation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds the important behavior that no query is executed and that results are planner estimates rather than actual row counts. It also discloses the output shape (rows, baseline, ratio) beyond what the input schema provides, though it does not address error behavior or limits.

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 tightly packed sentences lead with the core action, then state the return values and usage context without repetition or filler. Every clause earns its place.

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?

For a read-only estimation tool with idempotence annotations and an output schema present, the description provides the essential behavioral distinction (no execution), the output semantics, and the two primary use cases. Nothing critical is missing for an agent to decide whether and how to call it.

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?

With schema description coverage at 50%, the schema already documents predicate and connection. The description clarifies that the predicate is a proposed table filter and that the baseline is the unfiltered count, but table and schema parameters remain mostly implicit and are not described in the text, so the description only partially compensates for the coverage 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 opening verb 'Estimate' plus the object 'selectivity of one proposed table predicate' states exactly what the tool computes, and 'without executing the query' sets it apart from execution-oriented siblings such as executeQuery and timedQuery. The return values and intended use cases further clarify the resource being analyzed.

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?

'Use when evaluating filters or composite-index column order' gives explicit context for choosing this tool. It does not name alternatives or explicit when-not-to-use conditions, but the 'proposed... without executing' wording makes the boundary versus query execution clear enough.

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