Skip to main content
Glama

Query audience

query_audience
Destructive

Count a cohort without saving anything (nothing appears in the console): run up to 10 segment rules now and get the counts (matched, opted out, eligible to text) and the first contacts. Examples: replied in the last 7 days (last_reply_at after 7d); got a batch and did not reply (batch sent, and batch replied with is_not); started checkout but never purchased (event exists, event not_exists); VIPs not texted in 30 days. Same rule fields as a saved segment. Everyone eligible to text: one rule, status is subscribed.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "query_audience"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoHow many matching contacts to return
matchNoall: a contact must match every rule. any: at least one ruleall
rulesNoUp to 10 rules that decide who matches
topic_idNoTopic id or name: eligible also removes contacts unsubscribed from it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / match / description
      Added value: +"all: a contact must match every rule. any: at least one rule"
    • addedInput schema / properties / rules / description
      Added value: +"Up to 10 rules that decide who matches"
  2. First observed

TDQS

B3.4/5.0
Behavior1/5

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

The description frames this as a non-mutating count ('without saving anything', 'nothing appears in the console'), but the annotations declare readOnlyHint=false and destructiveHint=true. That is a direct conflict about whether the tool changes state, so an agent cannot trust either source. The useful extra context (10-rule cap, three count buckets, returning first contacts) does not resolve the contradiction.

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 no-save caveat and the core behaviour come first, followed by examples that give an agent executable patterns. The sentence is dense and the examples sit mid-paragraph rather than in a clean list, which costs a little readability, but nothing is wasted.

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 correctly explains the return values (matched, opted out, and eligible-to-text counts plus first contacts). A sophisticated nested rules structure is well supported. It only falls short because the mutation-safety story is inconsistent with the annotations.

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 the baseline is 3, and the description adds real meaning on top: rules use the same fields as a saved segment, the examples show how to express time windows and negative matches, and 'one rule, status is subscribed' gives a concrete, ready-to-use formulation. This maps directly onto how match, rules, and topic_id should be combined.

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?

It states a specific verb and resource ('Count a cohort... run up to 10 segment rules now and get the counts') and distinguishes itself from a saved segment by saying nothing is saved and nothing appears in the console. It stops short of naming the closest siblings (preview_segment, create_segment), so the differentiation is implicit rather than explicit.

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 gives clear usage context: ad-hoc counting, up to 10 rules, examples of typical cohorts, and a specific recipe for 'everyone eligible to text'. It never says when to use preview_segment or create_segment instead, so the alternative-selection guidance is inferential.

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.