Skip to main content
Glama
stevyf93II

catalog-mcp

by stevyf93II

Count records by field

catalog_count_by
Read-onlyIdempotent

Group catalog records by a field and get counts per value, sorted by frequency. Optionally filter records first to count only matching entries.

Instructions

Group records by a field and count each value, most common first. Array fields count each element. Optional filter applies first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldYes
filterNoFilter spec. Keys: eq (equality: {"type":"tent","heated":true}), min / max (numeric bounds: {"price":100}; records without a number in a bounded field are excluded), has (array membership, all required: {"tags":["a","b"]}), contains (case-insensitive substring: {"name":"alpine"}; use field "*" to search all string fields).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations indicate readOnlyHint, openWorldHint, idempotentHint, and non-destructive. The description aligns with these, adding the behavior of array fields counting each element and default sorting. It also mentions that the filter applies first, influencing results. This adds some value beyond annotations, but it doesn't disclose potential performance implications or edge cases like missing fields.

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?

The description is two sentences with high information density. It front-loads the core behavior, then covers edge cases (arrays) and optional filtering. No fluff; every sentence earns its place.

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 read-only aggregation tool with a well-documented filter schema, the description covers the essential aspects: what it does, how arrays are handled, and that filter applies first. It could mention the return format (e.g., array of {value, count}) since there is no output schema, but the absence is not critical for calling the tool correctly.

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 50%: the filter parameter is well-documented in the schema, but the field parameter has no description. The tool description does not add any details about the field parameter (e.g., type, syntax, examples). It implicitly clarifies that field is used for grouping, but the schema already does that. With only half the parameters covered, the description should compensate but doesn't significantly.

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 clearly states the action (group and count), the resource (records by a field), and the ordering (most common first). It also explains a key nuance: array fields count each element. It distinguishes itself from siblings like catalog_stats by focusing on counting per value rather than aggregate statistics, though it doesn't explicitly name an alternative.

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?

The description implies when to use this tool: when you want a frequency distribution of field values. It mentions an optional filter but does not specify alternatives or when not to use it. For example, it doesn't differentiate from catalog_values (which might return distinct values) or catalog_stats (aggregates). The usage guidance is clear but not exhaustive.

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