Skip to main content
Glama
kLOsk

AdLoop: Google Ads, Reddit Ads & GA4

Draft a Tag Manager trigger

draft_gtm_trigger

Draft creating or updating a Google Tag Manager trigger and get a preview of the workspace changes, without publishing anything to the live site.

Instructions

Draft creating or updating a Tag Manager trigger — returns a PREVIEW.

Without trigger_id this creates a trigger in a workspace; with trigger_id it updates the existing one. The edit lands in the workspace and changes nothing on the site until the workspace is published. Refused unless gtm.write_enabled is set. Returns the resolved workspace, the trigger fields that would change and a plan_id.

Tag Manager API: https://developers.google.com/tag-platform/tag-manager/api/v2

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoTrigger name, 1-200 characters. Required when creating a trigger.
notesNoFree-form note stored on the trigger. None keeps the current note.
filtersNoGTM conditions, each a dict with "type" (EQUALS, CONTAINS, MATCH_REGEX, ...) and "parameter" (arg0 = variable, arg1 = value), for example clicks on tel: links [{"type": "CONTAINS", "parameter": [{"type": "TEMPLATE", "key": "arg0", "value": "{{Click URL}}"}, {"type": "TEMPLATE", "key": "arg1", "value": "tel:"}]}]. On update the list replaces the existing one.
parametersNoGTM parameter dicts with at least "type" and "key". On update they merge by key: passed keys replace, other keys stay.
trigger_idNoExisting trigger ID to update (see list_gtm_triggers). Empty creates a new trigger.
trigger_typeNoTrigger type, required when creating a trigger and rejected on an existing one, because GTM cannot change it later: pageview, domReady, windowLoaded, click, linkClick, formSubmission, customEvent, elementVisibility, scrollDepth, youTubeVideo, historyChange, timer, jsError or triggerGroup.
workspace_idNoWorkspace to edit (see list_gtm_workspaces). Empty uses the Default Workspace, or the only workspace there is.
gtm_account_idNoNumeric GTM account ID (see list_gtm_accounts). Empty uses gtm.account_id from the config.
gtm_container_idNoNumeric GTM container ID (see list_gtm_containers). Empty uses gtm.container_id from the config.
custom_event_nameNoThe dataLayer event name. Required for trigger type customEvent, rejected for every other type, and rejected on an existing trigger, where the event name sits in its custom event filter.
auto_event_filtersNoConditions on automatic event parameters, same shape as filters. On update the list replaces the existing one.
custom_event_filtersNoConditions on custom event parameters, same shape as filters. On update the list replaces the existing one.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.27.1

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description goes well beyond by disclosing that this is a preview-only write, that nothing hits the site until publish, the config gate (gtm.write_enabled), and the returned plan_id/change set. That is the exact behavioral context an agent needs before invoking a draft mutation.

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?

Front-loads the key fact (preview, no site change) and keeps four short sentences, each carrying a distinct behavioral fact. Slightly over-resolved given the publisher/config gate is repeated in concept, but no wasted clauses.

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 draft mutation with an output schema, the description covers the create/update branch, the preview semantics, the publish dependency, the auth/config gate, and points to the API doc. Return values are handled by the output schema, so nothing an agent needs to call this correctly is missing.

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 including trigger_id, trigger_type and custom_event_name is already documented in the schema. The description's trigger_id create/update note duplicates that coverage rather than adding new syntax or format meaning, 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+resource ('Draft creating or updating a Tag Manager trigger') and immediately clarifies it returns a PREVIEW rather than applying changes. The create-vs-update branching on trigger_id distinguishes it from sibling readers like get_gtm_trigger and from draft_gtm_tag.

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?

Clearly routes between create (no trigger_id) and update (with trigger_id), and states the precondition 'Refused unless gtm.write_enabled is set' plus the fact that the edit is inert until the workspace is published. It never names whitelisted alternatives such as draft_gtm_tag or the confirm_and_apply follow-up, so 4 rather than 5.

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