Skip to main content
Glama

group_count

Count records grouped by a field value, such as orders by financialStatus or products by vendor, and get exact totals for enum and boolean fields or scanned estimates otherwise.

Instructions

Count records grouped by a field's value, e.g. orders by financialStatus or products by vendor. Exact for enum and boolean fields; other fields are counted by scanning (up to max_records) and say whether the result is exact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNoFor non-enum fields: how many groups to return, largest first (default 50)
fieldYesScalar or enum field to group by, e.g. financialStatus
modelYesModel name in singular camelCase, e.g. shopifyOrder
filterNoOptional filter applied before grouping
max_recordsNoFor non-enum fields: records to scan (default 10000, max 20000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose a genuinely non-obvious behavioral trait: accuracy is field-type dependent, non-enum fields are computed by scanning up to max_records, and the result self-reports whether it is exact. It still omits permissions, cost/latency implications of scanning, and truncation behavior, but the key semantic caveat is surfaced.

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?

Two sentences, front-loaded with purpose followed by the accuracy caveat; no filler. Dense but efficient, and each clause carries information the schema does not.

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 5-parameter read tool with no output schema and no annotations, the description covers the essential correctness caveat (exact vs. scanned) and ties it to the scan limit. It is not fully complete, since the shape of the returned grouped counts and behavior under filters are unstated, but nothing critical to calling it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning by linking max_records to the non-enum scanning path and framing field as an enum/boolean vs. scalar distinction. It also implies top is only relevant for non-enum fields, consistent with the schema notes.

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 states a specific verb (count), resource (records), and a precise grouping semantic ('grouped by a field's value') with concrete examples (orders by financialStatus, products by vendor). It does not, however, distinguish itself from the sibling count_records, leaving the agent to infer the boundary.

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 implied through the exactness note: enum/boolean fields are exact, other fields are scan-based, which tells the agent which field types to prefer. But there is no explicit when-to-use guidance and no mention of count_records as the alternative for ungrouped totals, so tool selection against the closest sibling is left to inference.

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