Skip to main content
Glama

Supabase: Count rows

supabase_count_rows
Read-only

Count rows in a Supabase table, optionally matching filter conditions, to retrieve record totals without fetching full data.

Instructions

[UNIFIED] Count rows in a table, optionally matching filter conditions.

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

Input Schema

NameRequiredDescriptionDefault
siteYes
tableYes
filtersNo
use_service_roleNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.14.0
  2. Removedv3.13.1
  3. First observedv3.4.0

TDQS

B3/5.0
Behavior2/5

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

readOnlyHint=true already tells the agent this is a safe read, so the description needed to add context beyond that and largely does not. It says nothing about whether a filtered count scans the whole table, how errors on a missing table surface, or what the service-role flag does to permissions/RLS — all substantive for a count operation against Supabase.

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?

A single front-loaded sentence with no filler and no repetition of the title. It is efficient, though its brevity is partly the cause of the semantic gaps rather than a virtue.

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 simple count tool on a read-only path, the description covers the core contract adequately, and no output schema means the return value is unspecified but predictable. Given 0% parameter documentation and no mention of service-role semantics, an agent could still call it incorrectly, particularly around the filters array shape.

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

Parameters2/5

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

Schema description coverage is 0% for four parameters, so the description carries the full burden and only covers "filters" at the level of naming it. The filter encoding (array items are untyped), the meaning of "site", and the behavior of "use_service_role" (presumably bypassing RLS) are all left unexplained in both schema and description.

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?

The description gives a specific verb and resource ("Count rows in a table") plus the scoping modifier ("optionally matching filter conditions"), which cleanly separates it from the mutating siblings like supabase_delete_rows and supabase_insert_rows. It stops short of naming an alternative, so it does not reach the top of the scale.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the word "optionally" signals that filters can be omitted to count everything, which is a reasonable hint about when to pass filters. There is no explicit guidance on when to prefer this over supabase_execute_sql or supabase_get_database_stats, and no prerequisites or exclusions are stated.

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

Deploy Server

Other Tools