Skip to main content
Glama

GA4: create audience

ga4_create_audience
Destructive

Create an audience on a GA4 property (properties/). Each filter clause includes or excludes people on conditions that all hold: {event, at_least}, {dimension, match, value}, {dimension, in} or {any_of}. A person must meet every clause; for either/or, use one any_of. scope defaults to across_sessions (over all their visits); same_session and same_event need it met in one visit or one event. country is the full name Analytics shows, such as United States, not a code. People stay in it membership_duration_days (1 to 540). Additive: an audience already named display_name is returned as it is, and none is removed here. If this property's Google Ads link shares audiences, Google shares the new audience with that Google Ads account at once, for remarketing, and what is shared cannot be recalled; no ad uses it until a campaign there targets it.

Tools revision: d80f65c0.

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": {
      "property": "<property>",
      "display_name": "<display_name>",
      "description": "<description>",
      "membership_duration_days": "<membership_duration_days>",
      "filter_clauses": "<filter_clauses>"
    },
    "name": "ga4_create_audience"
  }
}

Input Schema

NameRequiredDescriptionDefault
propertyYes
descriptionYes
display_nameYes
filter_clausesYes1 to 5 clauses, each {"include": true|false, "scope": "across_sessions"|"same_session"|"same_event", "conditions": [1 to 10]}. A condition: {"event": name, "at_least": N}, {"dimension": d, "match": "exact"|"contains"|"begins_with"|"ends_with", "value": text}, {"dimension": d, "in": [texts]} or {"any_of": [2 to 10 conditions]}. d is one of: country, region, city, language, deviceCategory, operatingSystem, platform, firstUserSource, firstUserMedium, firstUserCampaignName. A person must meet every clause (any_of is either/or); scope defaults to across_sessions; country is the full name, e.g. United States.
membership_duration_daysYesDays people stay in it, 1 to 540.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true; the description adds genuinely non-obvious behavior beyond them: the call is additive, an existing audience with the same display_name is returned as-is (explaining the non-idempotency), and nothing is removed. It also discloses the key side effect the annotations cannot express: if the property's Google Ads link shares audiences, the new audience is shared immediately and 'what is shared cannot be recalled.' There is mild tension with destructiveHint=true since the tool itself deletes nothing, but the irreversible external sharing justifies the hint rather than contradicting it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, which is good, but the body is a single dense run-on paragraph mixing filter grammar, scope defaults, duration ranges, dedupe behavior and Google Ads sharing. Some clauses are grammatically squeezed ('People stay in it membership_duration_days (1 to 540)'), making it harder to scan than a short bulleted structure would be.

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 a 5-required-parameter mutation with an output schema and full annotation coverage, this is nearly complete: it explains idempotency-like dedupe, the irreversible sharing side effect, and clause logic. Missing pieces are minor — the meaning of the required 'description' field and whether the property must already exist.

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 coverage is only 40%, and the description partially compensates: it gives the property path format, the membership_duration_days range, and the clause/condition semantics. However, the clause semantics largely restate the already-detailed filter_clauses schema description, and the required 'description' parameter is never explained at all, leaving a real gap at low coverage.

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?

Opens with a precise verb+resource+target: 'Create an audience on a GA4 property (properties/<id>)'. That cleanly separates it from the many create_* siblings (create_campaign, ga4_create_property) and from ga4_list_audiences, and the parenthetical shows the property identifier format.

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 description supplies rich in-tool usage rules (all clauses must hold, any_of for either/or, scope default, country as full name), but it never states when to use this versus alternatives such as ga4_list_audiences to check for an existing audience, or when to prefer a report tool. There are also no explicit when-not conditions, so the agent must infer routing.

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