Skip to main content
Glama
supabase-mcp-server

supabase-mcp-server

Count rows

count_rows
Read-only

Count rows visible to the current role using structured filters, so you can verify dataset size or query results without retrieving full records.

Instructions

Counts rows visible to the current role, with the same structured filters as select_rows.

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": {
      "table": "<table>"
    },
    "name": "count_rows"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYes
schemaNopublic
filtersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, covering the safety profile. The description adds genuinely useful behavioral context beyond annotations by disclosing that counts are scoped to the current role's visibility, which matters for row-level-security environments. It does not mention approximate vs exact counts or performance characteristics.

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?

A single sentence that front-loads the action and scope with zero filler. Every clause (visible-to-role scoping, filter parity with select_rows) carries information.

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 counting tool with readOnly annotations, the description covers the key behavioral qualifiers: role-based visibility and filter parity with select_rows. The main gap is that no output schema exists and the description never states that the result is a numeric count, though the tool name strongly implies 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?

Schema description coverage is 0%, with three parameters (table, schema, filters), so the description must supply meaning. It partially compensates by delegating filter semantics to select_rows ('same structured filters'), but it does not explain the table/schema parameters or the filter operator/value semantics, leaving the agent reliant on reading another tool's schema.

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 verb ('Counts'), resource ('rows'), and scope ('visible to the current role'), and distinguishes itself from select_rows by contrasting counting with row retrieval. An agent can identify this as the aggregate counterpart to select_rows without opening the schema.

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?

The phrase 'with the same structured filters as select_rows' explicitly routes the agent to select_rows for filter semantics and implies this tool is for counting rather than fetching rows. It lacks an explicit when-not clause, but the context is clear.

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