Skip to main content
Glama
AlexStansfield

gtm-mcp-server

Create GTM Trigger

gtm_create_trigger

Create a new trigger in a Google Tag Manager workspace by specifying account, container, workspace, trigger name, type, and optional filters.

Instructions

Create a new trigger in a workspace.

Common trigger types:

  • PAGEVIEW: Fires on page view

  • CLICK: Fires on click events

  • LINK_CLICK: Fires on link clicks

  • FORM_SUBMISSION: Fires on form submit

  • CUSTOM_EVENT: Fires on custom dataLayer events

  • DOM_READY: Fires when DOM is ready

  • WINDOW_LOADED: Fires when window loads

  • ELEMENT_VISIBILITY: Fires when element becomes visible

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName for the trigger
typeYesTrigger type (PAGEVIEW, CLICK, CUSTOM_EVENT, etc.)
filterNoGeneral filter conditions for the trigger
account_idYesThe GTM account ID
container_idYesThe GTM container ID
workspace_idYesThe GTM workspace ID
custom_event_filterNoFor CUSTOM_EVENT triggers, the event filter conditions

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

No additional behavioral traits disclosed beyond annotations (none). Does not mention side effects, constraints, or prerequisites beyond required parameters.

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?

Description is concise, presents a clear list of common trigger types. Schema is well-organized with nested objects and enums. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Provides basic context about what triggers do, but lacks details on when to use specific types or how filters work beyond schema. Could include examples or usage notes.

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 includes descriptions for all parameters and provides type info and examples for filter structure, though some descriptions are terse (e.g., 'Name for the trigger').

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?

The description clearly states the tool creates a trigger in a workspace.

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?

Lists common trigger types, which gives context, but lacks explicit guidance on when to use this vs. update/list tools. However, the verb 'create' and presence of other CRUD siblings make the purpose clear.

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