Skip to main content
Glama

Count records

count_records
Read-onlyIdempotent

How many records a search matches, and how they break down, with no rows read: the answer to every "how many". Say what to count (of: companies, deals, buyers, offerings, placement_agents, people) and give that kind's own search filters in where, by the same names its search takes, lists included. A count of companies says how many have a phone, an e-mail, both, neither, a named person's own line and a named owner or officer; by breaks a total down (companies by naics or state; deals by sector, deal_type or year; offerings by industry, state, sales_pay, fund_type, month or phone). One call a question. Never page through a search to count it, and never start subagents to count.

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": {
      "of": "<of>"
    },
    "name": "count_records"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNoBreak the total down by these. companies: naics (each code searched), state. deals: sector, deal_type, year. offerings: industry, state, sales_pay, fund_type, month, phone. A count of companies always says how many have a phone, an e-mail, both, neither, a named person's own line and a named owner or officer; a count of people, how many have an e-mail, a phone or both; so contact coverage needs no `by`.
ofYesWhat to count. companies: companies as find_companies finds them. deals: deals as search_deals finds them. buyers: the buyers find_buyers would list. offerings: Form D offerings as find_offerings finds them. placement_agents: the firms find_placement_agents would list. people: people as search_people finds them.
whereNoThe filters, by the same names that kind's own search takes (find_companies, search_deals, find_buyers, find_offerings, find_placement_agents, search_people), lists included: {"naics": ["237130", "238910"], "state": ["TX", "LA"], "min_staff": 30}. page, limit, sort and include_contacts are not filters and are ignored.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), but the description adds a real behavioral trait beyond them: counts are computed 'with no rows read', so the agent knows it gets aggregates, not records. It also discloses implicit outputs (company counts always report phone/e-mail/both/neither/person/owner coverage). It stops short of stating cost, limits, or response shape.

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?

Front-loaded with the core claim in the first clause, then organized as what-to-count, how-to-filter, how-to-break-down, and anti-patterns. Some of the `by` breakdown enumeration duplicates the schema description, costing a few words, but nothing is 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?

With no output schema, the description carries the return-value burden and does say it returns totals plus breakdowns, though the exact result shape is left implied. For a 3-parameter read-only aggregate tool with full schema coverage, this is nearly complete.

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 3 is the baseline, but the description adds meaning on top: it ties each `of` value to the sibling search whose filters apply, enumerates valid `by` breakdowns per kind, and warns that page, limit, sort and include_contacts are ignored rather than errors. That is genuinely beyond the schema text.

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 and resource ('how many records a search matches, and how they break down') and frames the tool as 'the answer to every "how many"'. It also explicitly separates itself from search siblings by saying never to page through a search to count.

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

Usage Guidelines5/5

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

Gives positive guidance (pick `of`, pass that kind's own search filters via `where`, use `by` only for breakdowns) and explicit negative guidance ('one call a question', 'never page through a search to count it', 'never start subagents to count'). The when-not rules are unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources