Skip to main content
Glama

Count a newsletter audience

count_newsletter_audience
Read-onlyIdempotent

How many addresses an audience (segments, tags, filters, exclusions) would reach now, after consent and suppressions: eligible, in scope, not subscribed, suppressed and at the frequency cap. Nothing is saved.

Input Schema

NameRequiredDescriptionDefault
audienceNoWho it goes to: contacts in ANY (match "any") or ALL (match "all") of the included segments, tags and filters, minus the excluded ones. Nothing included means every contact of the product. Consent and suppressions are always applied on top.
productIdNoProduct id from list_products.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • changedInput schema / properties / audience / properties / excludeFilters / description
      Previous value: -"Conditions on contact fields. mode \"all\" or \"any\"; each rule is { field, operator, value }. Fields: contact.name, contact.email, contact.consent (subscribed | unknown | unsubscribed), contact.email_status, contact.product_id, contact.created_at, contact.last_seen_at, contact.attributes.<field> (tags are contact.attributes.tags), contact.events.<event>. Operators: is, is_not, contains, not_contains, gt, lt, exists, missing, before, after (dates are ISO or now-7d)."New value: +"Conditions on contact fields. mode \"all\" or \"any\"; each rule is { field, operator, value }. Fields: contact.name, contact.email, contact.consent (subscribed | unknown | unsubscribed), contact.email_status, contact.product_id, contact.created_at, contact.last_seen_at, contact.attributes.<field> (tags are contact.attributes.tags), contact.events.<event>. Operators: is, is_not, contains, not_contains, gt, gte, lt, lte, between (value and value2), any_of and none_of (value is a list of strings), exists, missing, before, after (dates are ISO or now-7d)."
    • changedInput schema / properties / audience / properties / excludeFilters / properties / rules / items / properties / operator / enum
      Previous value: -[
      -  "is",
      -  "is_not",
      -  "contains",
      -  "not_contains",
      -  "gt",
      -  "lt",
      -  "exists",
      -  "missing",
      -  "before",
      -  "after"
      -]New value: +[
      +  "is",
      +  "is_not",
      +  "contains",
      +  "not_contains",
      +  "gt",
      +  "gte",
      +  "lt",
      +  "lte",
      +  "between",
      +  "any_of",
      +  "none_of",
      +  "exists",
      +  "missing",
      +  "before",
      +  "after"
      +]
    • addedInput schema / properties / audience / properties / excludeFilters / properties / rules / items / properties / value / anyOf
      Added value: +[
      +  {
      +    "type": [
      +      "string",
      +      "number",
      +      "boolean"
      +    ]
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / audience / properties / excludeFilters / properties / rules / items / properties / value / type
      Removed value: -[
      -  "string",
      -  "number",
      -  "boolean"
      -]
    • addedInput schema / properties / audience / properties / excludeFilters / properties / rules / items / properties / value2
      Added value: +{
      +  "type": [
      +    "string",
      +    "number"
      +  ]
      +}
    • changedInput schema / properties / audience / properties / filters / description
      Previous value: -"Conditions on contact fields. mode \"all\" or \"any\"; each rule is { field, operator, value }. Fields: contact.name, contact.email, contact.consent (subscribed | unknown | unsubscribed), contact.email_status, contact.product_id, contact.created_at, contact.last_seen_at, contact.attributes.<field> (tags are contact.attributes.tags), contact.events.<event>. Operators: is, is_not, contains, not_contains, gt, lt, exists, missing, before, after (dates are ISO or now-7d)."New value: +"Conditions on contact fields. mode \"all\" or \"any\"; each rule is { field, operator, value }. Fields: contact.name, contact.email, contact.consent (subscribed | unknown | unsubscribed), contact.email_status, contact.product_id, contact.created_at, contact.last_seen_at, contact.attributes.<field> (tags are contact.attributes.tags), contact.events.<event>. Operators: is, is_not, contains, not_contains, gt, gte, lt, lte, between (value and value2), any_of and none_of (value is a list of strings), exists, missing, before, after (dates are ISO or now-7d)."
    • changedInput schema / properties / audience / properties / filters / properties / rules / items / properties / operator / enum
      Previous value: -[
      -  "is",
      -  "is_not",
      -  "contains",
      -  "not_contains",
      -  "gt",
      -  "lt",
      -  "exists",
      -  "missing",
      -  "before",
      -  "after"
      -]New value: +[
      +  "is",
      +  "is_not",
      +  "contains",
      +  "not_contains",
      +  "gt",
      +  "gte",
      +  "lt",
      +  "lte",
      +  "between",
      +  "any_of",
      +  "none_of",
      +  "exists",
      +  "missing",
      +  "before",
      +  "after"
      +]
    • addedInput schema / properties / audience / properties / filters / properties / rules / items / properties / value / anyOf
      Added value: +[
      +  {
      +    "type": [
      +      "string",
      +      "number",
      +      "boolean"
      +    ]
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / audience / properties / filters / properties / rules / items / properties / value / type
      Removed value: -[
      -  "string",
      -  "number",
      -  "boolean"
      -]
    • addedInput schema / properties / audience / properties / filters / properties / rules / items / properties / value2
      Added value: +{
      +  "type": [
      +    "string",
      +    "number"
      +  ]
      +}
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered structurally. The description adds valuable behavioral context: the count is evaluated at the current moment, consent and suppressions are always applied, frequency caps are included, and nothing is persisted. A minor gap is that the exact breakdown of the returned count categories is only loosely hinted at.

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 description is compact and front-loaded with the core purpose, and every clause contributes useful information. The list of counted states is dense but relevant, though 'eligible, in scope, not subscribed, suppressed and at the frequency cap' could be slightly clearer as return-category language.

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 a rich input schema and strong annotations, the description covers the essential remaining context: it is a point-in-time, non-persisting count that applies consent, suppressions, and frequency caps. Since there is no output schema, the description could more explicitly define the returned count categories, but it provides enough for an agent to call and interpret 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 100%, and the nested audience schema already documents includeSegments, includeTags, filters, exclusions, match semantics, and productId. The description mentions the same concepts (segments, tags, filters, exclusions) but adds no format or precedence details beyond what the schema provides, which is the expected baseline when the schema is this rich.

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?

States a specific verb and resource ('How many addresses an audience ... would reach') and clarifies what an audience is composed of. It does not explicitly name or contrast with siblings like count_contacts or preview_newsletter, so the distinction is inferred rather than stated.

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 phrase 'would reach now' and 'Nothing is saved' imply this is a pre-send sizing/check operation, but there is no explicit when-to-use versus when-to-use-something-else guidance. The agent must infer that this is the right tool before creating or sending a newsletter.

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