Skip to main content
Glama

count_rows

Count rows in a table without running SQL to size it before indexing, partitioning, or sampling.

Instructions

Count rows in a table without running SQL. Useful to size a table before indexing, partitioning or sampling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable name.
schemaNoSchema (owner) of the table. Optional — defaults to the server's current schema; omit rather than guess.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.16.3

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. "Without running SQL" is a genuine behavioral disclosure (no SQL parsing/privilege path), but it omits whether the count is exact or from stats, the cost on very large tables, required table-level privileges, and behavior for views or missing tables.

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 short sentences with zero filler; the core operation is front-loaded before the use-case rationale. Nothing could be cut without losing information.

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?

For a low-complexity two-parameter tool this is nearly adequate, but with no output schema the description never states the return shape (a single integer row count) or error behavior on nonexistent/inaccessible tables, leaving a small but real gap.

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 100%, and the schema itself carries a strong hint for the optional schema param ("omit rather than guess"). The description adds no parameter-level meaning beyond that, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a precise verb+resource ("Count rows in a table") and adds the differentiator "without running SQL," which implicitly contrasts it with run_query. It doesn't explicitly name a sibling alternative, so it lands just short of a 5.

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?

"Useful to size a table before indexing, partitioning or sampling" gives clear when-to-use context tied to concrete workflows. It stops short of naming the alternative for similar information (e.g., get_table_stats, which also exposes row counts) or saying when not to use it.

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