Skip to main content
Glama

Count an audience

preview_contact_segment
Read-onlyIdempotent

Count how many contacts a proposed filter — or an existing segment (segment_id) — matches right now, WITHOUT saving anything. Use it to tell the user "that is 34 people" before saving a segment or drafting a campaign. Filter values are checked against the site first, so an invented tag comes back as a refusal listing the real ones, not as zero.

Input Schema

NameRequiredDescriptionDefault
tagsNoTags the contact must carry — ALL of them. Values exactly as list_contact_filter_vocabulary returns them, capitals and spaces included
fieldsNoCustom field filters: field_key → exact value, e.g. {"budget":"high"}. Keys from list_contact_filter_vocabulary; a select field's value must be one of its options
searchNoFree text matched against email, first name, last name and company
statusNoPipeline status the contact must have
site_idYesThe site, from list_sites
user_goalNoOptional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details.
segment_idNoA segment id, from list_contact_filter_vocabulary
appointmentNoAppointment state: upcoming (booked, still to come), pending (upcoming, waiting for the owner to confirm), needs_time (asked for an appointment, waiting for the owner to pick a time), had (has had one before)
field_rulesNoTyped custom-field rules, all must match. op "in"/"not_in" take values (e.g. countries ["BR","IN"]); "gt"/"lt" take a numeric value (numeric fields only); "before"/"on_or_after" take value "YYYY-MM-DD"; "is_set"/"is_not_set" take nothing. Prefer this over `fields` for anything but one exact value
acquisition_sourceNoLead source, exactly as list_contact_filter_vocabulary returns it
acquisition_campaignNoAcquisition campaign, exactly as list_contact_filter_vocabulary returns it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / user_goal
      Added value: +{
      +  "description": "Optional: the user's goal behind this call, in one short sentence of plain words (e.g. \"add a page so customers can book tables\"). No names, emails or other personal details.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations, it discloses that the count is live, nothing is saved, and invalid filter values trigger a refusal listing real values rather than returning zero. This adds meaningful error and usage behavior that an agent could not infer from readOnlyHint alone.

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 short, front-loaded with the core action, and every sentence adds useful information: what it does, when to use it, and how bad filter values are handled.

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 an 11-parameter nested filter tool with no output schema, the description covers purpose, non-mutation, and validation behavior well. It could say more about the response shape, but the examples and schema descriptions make it adequate for correct invocation.

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%, so the parameter descriptions already carry the detailed semantics. The tool description adds some contextual meaning around segment_id and filter validation, but does not elaborate on individual parameters beyond 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?

The description states a specific verb and resource: count contacts matching a proposed filter or existing segment_id. It explicitly contrasts the operation with saving or drafting, distinguishing it from create_contact_segment and draft_campaign.

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

Usage Guidelines4/5

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

It clearly says when to use it: to tell the user the audience size before saving a segment or drafting a campaign. It does not explicitly name alternatives, but the 'before saving' framing gives strong contextual guidance.

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