Skip to main content
Glama

Count an audience

count_audience
Read-onlyIdempotent

Counts UK contacts and companies matching an audience, inline or a saved aud_ id, and returns Total, New to you and Emailable, up to three breakdowns, quality, the compliance summary, a price estimate and a count id. Use it whenever a filter changes, and before preview_records or quote_order, which both take the count id. Free and needs no account; anonymous and trial callers see counts under 100 and breakdown cells rounded to the nearest 5 (disclosure says which), and exact small counts need a paid plan. It returns no contact details, and over MCP a cross-tab holds at most 200 cells (truncated true; GET /v1/counts/{id} has the rest). Lawful basis is UK GDPR Article 6(1)(f) legitimate interests; email audiences include corporate subscribers only by default (PECR), so sole traders and ordinary partnerships are left out unless the toggle is changed.

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": {
      "audience": "<audience>"
    },
    "name": "count_audience"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNocontact (the default) or company. Contacts and companies come back together either way.contact
audienceYes
breakdown_byNoUp to three fields to break the count down by, each once, such as industry by seniority by region. Returns the top 50 cells per field plus other.

Output Schema

NameRequiredDescriptionDefault
idYesFormat: a count id: cnt_ followed by 20 base32 characters (A to Z and 2 to 7), such as cnt_7K2PQ4MAXN3R6TBY5WDZ.
planNo
as_ofNoThe date the dataset version was built, for as-of statements.
levelNocontact (the default) or company. Contacts and companies come back together either way.
viewsNo
currentNoOn a replay: the same audience on the current dataset version.
datasetYesThe dataset an audience draws from. uk_contacts is live; ie_contacts and global_contacts are listed but not yet served.
premiumYesPremium: the contacts of all_records that are premium records (contact.premium true). Premium records: at an active company, with contact details checked within the last 12 months. Null when the dataset version carries no premium data, or withheld when the premium records are at a single company and the caller has no account; premium_note says which.
qualityYes
contactsYesTotal: every matching contact.
crosstabNo
defaultsYesEvery default with the number behind its toggle: dissolved and insolvent, generic emails, individual subscribers, TPS and CTPS registered.
estimateYes
warningsNo
companiesYes
emailableYesA named email scoring 70 or more at a corporate subscriber.
breakdownsYes
created_atNo
disclosureYes
expires_atYesThe id replays until then (12 months).
new_to_youYesExcludes your earlier orders and CRM overlap; null when signed out.
all_recordsYesAll records: every matching contact with the audience's top-level premium filters taken out (a premium filter inside any or not stays), so the premium figure always has the full figure beside it. The same as contacts when the audience has no premium filter.
premium_noteYesWhat premium means on this dataset version, or why premium is null: no premium data on the version, or withheld because the premium records are at a single company.
removed_sinceNoOn a replay: records since removed by objections and erasure.
expanded_termsNoEvery title a matches filter covered, with a count per term.
dataset_versionYesThe immutable weekly build a count is bound to, such as 2026-W39. The last 52 stay queryable.
compliance_summaryYes
credits_per_recordYesCredits, to one decimal place: whole at 1 credit a record, fractional only where a rule is (0.1 company-only, 1.8 outright, both proposed).
effective_audienceNoThe definition after defaults and bundles, as hashed into the id.
emailable_step_downNoWhy Emailable is below Total, step by step. Null when the audience dedupes (one per company or site), as the views then count companies or sites, not contacts.
engine_rules_versionYesThe engine rules (title expansion, defaults, geography sets) the count ran under; part of what the count id hashes, such as 2026.09.1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / $defs / SinceFilter / properties / field / enum
      Previous value: -[
      -  "contact.last_validated_at",
      -  "email.last_verified_at",
      -  "signal.type",
      -  "signal.observed_at"
      -]New value: +[
      +  "contact.last_validated_at",
      +  "contact.last_confirmed_at",
      +  "contact.privacy_notice_last_sent_at",
      +  "contact.privacy_notice_first_sent_at",
      +  "email.last_verified_at",
      +  "signal.type",
      +  "signal.observed_at"
      +]
    • changedOutput schema / $defs / SinceFilter / properties / field / enum
      Previous value: -[
      -  "contact.last_validated_at",
      -  "email.last_verified_at",
      -  "signal.type",
      -  "signal.observed_at"
      -]New value: +[
      +  "contact.last_validated_at",
      +  "contact.last_confirmed_at",
      +  "contact.privacy_notice_last_sent_at",
      +  "contact.privacy_notice_first_sent_at",
      +  "email.last_verified_at",
      +  "signal.type",
      +  "signal.observed_at"
      +]
  2. Changed5 schema fields changed
    • addedOutput schema / $defs / EmailableStepDown
      Added value: +{
      +  "description": "Why Emailable is below Total, in sequential steps: no named business email, then the email check, then the corporate subscriber default.",
      +  "properties": {
      +    "adds_up": {
      +      "description": "True when the steps add up to total less emailable as shown. Always true for exact figures; rounding to 5 for anonymous and trial callers can leave it false, and each step is then about that figure.",
      +      "type": "boolean"
      +    },
      +    "email_check_basis": {
      +      "description": "What the email_check step rests on. measured: each address's own verification. premium_list: this dataset version records no per-record verification; records on the premium list count as checked and the rest are not yet checked, so the email_check step is mostly records not yet checked rather than records that failed a check. Left out, read it as measured.",
      +      "enum": [
      +        "measured",
      +        "premium_list"
      +      ],
      +      "type": "string"
      +    },
      +    "emailable": {
      +      "description": "views.emailable.contacts, as shown.",
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "steps": {
      +      "description": "Always the three steps, in this order; a step can be 0.",
      +      "items": {
      +        "properties": {
      +          "contacts": {
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "id": {
      +            "description": "no_named_email: no email, or a generic (info@, sales@) address. email_check: of the rest, a deliverability score under email_policy.min_deliverability_score, or catch-all when the policy leaves catch-all out. corporate_subscribers: of the rest, not at a corporate subscriber.",
      +            "enum": [
      +              "no_named_email",
      +              "email_check",
      +              "corporate_subscribers"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "contacts"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "total": {
      +      "description": "views.total.contacts, as shown.",
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "total",
      +    "emailable",
      +    "steps",
      +    "adds_up"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / $defs / PriceEstimate / properties / gbp_ex_vat / additionalProperties / description
      Previous value: -"Pounds sterling excluding VAT, to two decimal places."New value: +"Pounds sterling to two decimal places, plus VAT (VAT is not included in this figure)."
    • changedOutput schema / $defs / PriceEstimate / properties / gbp_ex_vat / description
      Previous value: -"The price in GBP excluding VAT: per_contact_scale (every credit at the scale) and cheapest (the cheapest real purchase, at the scale or with credit packs)."New value: +"The price in GBP, plus VAT (VAT is not included in these figures): per_contact_scale (every credit at the scale) and cheapest (the cheapest real purchase, at the scale or with credit packs)."
    • addedOutput schema / properties / emailable_step_down
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/EmailableStepDown"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Why Emailable is below Total, step by step. Null when the audience dedupes (one per company or site), as the views then count companies or sites, not contacts."
      +}
    • changedOutput schema / properties / premium / description
      Previous value: -"Premium: the contacts of all_records that are premium records (contact.premium true). At launch, a premium record is in the premium export of a stated date. Null when the dataset version carries no premium data, or withheld when the premium records are at a single company and the caller has no account; premium_note says which."New value: +"Premium: the contacts of all_records that are premium records (contact.premium true). Premium records: at an active company, with contact details checked within the last 12 months. Null when the dataset version carries no premium data, or withheld when the premium records are at a single company and the caller has no account; premium_note says which."
  3. Changed1 schema field changed
    • addedInput schema / properties / audience / type
      Added value: +[
      +  "string",
      +  "object"
      +]
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and destructiveHint=false, so the description goes beyond by disclosing anonymous/trial truncation (counts under 100, cells rounded to nearest 5), the paid-plan requirement for exact small counts, the 200-cell MCP cross-tab cap with truncation and the GET /v1/counts/{id} fallback, and the PECR corporate-subscriber default. It also states it returns no contact details, which is valuable behavioral context. The one gap is that the lawful-basis sentence is compliance colour rather than actionable behavior.

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?

The definition is front-loaded with the core action and the most important sibling routing, and nearly every sentence adds distinct value (limits, truncation, compliance default). It is a dense single paragraph with a run-on feel, so it is slightly less scannable than ideal, but nothing is clearly redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex counting tool with an output schema, the description covers the action, the routing to siblings, the free/anonymous limits, the cross-tab truncation escape hatch, and the email-policy default. An agent has everything needed to call it correctly and interpret the response caveats.

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 67%, so the description needs to compensate and largely does: it clarifies that audience can be inline or a saved aud_ id and that up to three breakdowns are allowed. However, it never mentions the 'level' parameter (contact vs company) or dedupe, so a few parameters remain explained only by the schema.

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 (counts UK contacts and companies matching an audience) and names the output components (Total, New to you, Emailable, breakdowns, quality, compliance summary, price estimate, count id). It also distinguishes itself from siblings preview_records and quote_order, so an agent can tell what it does without opening the schema.

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?

Explicitly says 'Use it whenever a filter changes, and before preview_records or quote_order, which both take the count id.' This names the trigger condition and the downstream alternatives, and adds that it is free and needs no account, leaving nothing to inference.

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