Skip to main content
Glama
Firenook

Firenook

Official

firestore_count

Count Firestore documents in a collection or collection group that match optional AND filters, using an aggregation query that reads no documents.

Instructions

Count the documents of a collection, or with collectionGroup of every collection with that id, that match optional where filters (a COUNT aggregation; no documents are read back).

Input Schema

NameRequiredDescriptionDefault
whereNoFilters combined with AND
databaseNoFirestore database id; default (default)
collectionYesCollection path, or a collection id with collectionGroup
collectionGroupNoCollection-group query: every collection with the last segment's id at any depth under the parent (the database root for a bare id, e.g. posts; users/alice/posts for one document's descendants)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it does disclose that this is an aggregation that reads no documents, which implies a read-only, low-payload operation. It says nothing about required permissions, consistency/accuracy of the count, or billing/cost characteristics of aggregation queries, all relevant for a Firestore count tool.

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 that opens with the verb and resource, then layers scope qualifiers. It is dense with nested clauses and parentheticals but contains no filler.

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 four-parameter read tool with full schema coverage, the description covers the core semantics and the key behavioral note that no documents are returned. The absence of an output schema would normally require the description to say what comes back; 'count' implies a numeric total, which is adequate but leaves the exact response shape implicit.

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%, so all four parameters including the collectionGroup depth semantics are already documented in the schema. The description restates that where filters are optional and that collectionGroup targets collections by id at any depth, but adds no syntax or behavioral detail beyond the structured fields.

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 names a specific verb and resource (count documents of a collection) and qualifies the scope with collectionGroup and where filters. The parenthetical '(a COUNT aggregation; no documents are read back)' implicitly distinguishes it from firestore_query and firestore_get, though it never names those siblings outright.

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?

There is no explicit 'use this when...' guidance or reference to firestore_query as the alternative. The phrase 'no documents are read back' hints that this is the cheap path when only a tally is needed, but the agent must infer that choice itself.

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