Skip to main content
Glama
AdLoop: Google Ads, Reddit Ads & GA4

AdLoop: Google Ads, Reddit Ads & GA4

Draft an Analytics audience

draft_ga4_audience
Destructive

Create, rename, or archive a GA4 audience and preview changes before applying them; use it to build remarketing lists for site visitors, buyers, or non-buyers.

Instructions

Draft creating, renaming or archiving a GA4 audience — returns a PREVIEW.

An audience is the users who sent certain events, viewed certain pages, or did a sequence of both in order. A linked Google Ads account receives it as a remarketing list within one to two days, to attach to campaigns with draft_audience_attachment: this is how to build a list of site visitors, of buyers, of visitors who did not buy, or of people who saw the pricing page without signing up. GA4 fixes the conditions and the membership duration at creation; afterwards only the name and description can change, and archiving is permanent (it needs a double confirmation). The draft refuses a taken name and a full property, and the preview warns when the property's audiences would not reach Google Ads (see list_ga4_audiences). Nothing changes until confirm_and_apply applies the plan_id.

Google Analytics Data API: https://developers.google.com/analytics/devguides/reporting/data/v1 and Admin API: https://developers.google.com/analytics/devguides/config/admin/v1

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": "draft_ga4_audience"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionNo"create" (default), "update" (name and description only) or "archive".create
audienceNoFor update and archive: the audience's display name or resource name from list_ga4_audiences.
sequenceNoCreate only, instead of include_events / include_pages. 2 to 10 steps the user must do in this order. Each is an event name ("begin_checkout") or an object: {"event": "..."} or {"page": "/pricing"}, optionally with "directly_followed": true (no other event in between) and "within_minutes": 30 (after the step before). Exclusions can be added as usual.
descriptionNoOptional for create (one is written from the events); the new description for update.
property_idNoGA4 property as "properties/123456789" or the bare numeric ID. If empty, uses the default from config.
display_nameNoName of the audience; required for create, the new name for update.
exclude_pagesNoCreate only. Users who viewed such a page are kept out, e.g. ["/thank-you"].
include_pagesNoCreate only. Users who viewed a page whose full URL contains ANY of these texts join, e.g. ["/pricing"] (also matches /pricing/enterprise and /en/pricing). Not case sensitive.
exclude_eventsNoCreate only. Users who sent any of these are kept out, e.g. include ["session_start"] and exclude ["purchase"] for visitors who did not buy.
include_eventsNoCreate only. Users who sent ANY of these events join, e.g. ["session_start"] for every visitor, ["purchase"] for buyers, ["sign_up", "generate_lead"] for leads. Together with include_pages it is still "any of".
exclude_permanentlyNoCreate only. True keeps users out for good once they sent an excluded event; False (default) only while they keep meeting the exclusion within the membership window.
membership_duration_daysNoCreate only. Days a user stays after last meeting the conditions, 1 to 540 (default 30).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.45.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the irreversibility bar is partly covered. The description nonetheless adds real substance beyond them: conditions and membership duration are frozen at creation, only name/description can later change, archiving is permanent and needs double confirmation, and the draft rejects taken names or a full property. It does not describe the preview payload's shape, though an output schema exists to carry that.

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 key constraint (PREVIEW, plan_id required) is front-loaded in the first sentence, and the lifecycle facts follow in a logical order. It is long for a single description and the trailing Google Analytics API documentation links do not materially help tool selection.

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 12-parameter drafting tool this covers the lifecycle (create/update/archive), permanence of archiving, validation failures, the delayed Google Ads propagation window, and the warning path via list_ga4_audiences. Return values are covered by the output schema, so no gap remains that would cause a misinvocation.

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 every parameter already documents its own semantics, including the sequence alternative to include_events/include_pages and the any-of inclusion logic. The description adds use-case framing but no parameter-level detail the schema lacks, so the baseline 3 applies.

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 ("Draft creating, renaming or archiving a GA4 audience") and immediately clarifies the output is a PREVIEW, not an applied change. It names the sibling that attaches the result (draft_audience_attachment) and the one that commits it (confirm_and_apply), so the agent can place it in the workflow without opening any other 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?

Gives concrete when-to-use scenarios (site visitors, buyers, visitors who did not buy, pricing-page viewers who never signed up) and explicitly routes downstream use through draft_audience_attachment. It also states the hard gate — nothing changes until confirm_and_apply applies the plan_id — which is effectively a when-not-to-expect-mutation rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools