Skip to main content
Glama

Google Ads & Meta Ads

Tag Manager: Update Trigger

gtm_update_trigger
DestructiveIdempotent

Change one existing trigger of a Google Tag Manager container in a draft workspace: replace its conditions (e.g. fix a Page URL filter that never matches the thank-you page), change a custom event trigger's event name, rename it or set notes. The trigger's kind cannot change; only the arguments passed change. Saved in the existing workspace the user names (ask which) and NOT published: the user reviews and publishes in Tag Manager. Requires editing to be enabled on the Tag Manager connection.

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": {
      "workspace": "<workspace>",
      "trigger": "<trigger>"
    },
    "name": "gtm_update_trigger"
  }
}

Input Schema

NameRequiredDescriptionDefault
notesNoReplaces the notes on the trigger. Optional.
triggerYesThe trigger to change: its name or id, as gtm_list_triggers_variables shows them.
new_nameNoA new name for the trigger. Optional.
containerNoThe container: its public id (GTM-XXXXXXX), its name, or its API path from gtm_list_containers. May be left out when the connected login reaches exactly one container.
workspaceYesThe existing Tag Manager workspace to save the draft in, by name or id, as the user named it (gtm_list_workspaces). Ask the user which workspace to use; never pick one yourself. Nothing is published.
conditionsNoConditions that must all hold for the trigger to fire; empty or omitted means every event of the type (every page view, every click). Each compares a variable with a value. At most 20. Built-in variables like Click Classes or Page Path must be enabled in the container to be used.
event_nameNoCustom event triggers: the new dataLayer event name. Optional.
event_name_regexNoWith event_name: treat it as a regular expression. Default false.

Output Schema

NameRequiredDescriptionDefault
nameYesThe trigger's name after the change.
typeNoGoogle's type code, e.g. pageview.
changedYesThe arguments that were applied.
publicIdNoPublic GTM-XXXXXXX id of the container.
publishedYesAlways false: the change is a draft until a version is created and published.
triggerIdYesId of the trigger inside the container.
conditionsYesIts conditions after the change, as "{{Page URL}} contains /thanks" lines.
workspaceIdYesId of the workspace the change was saved in.
workspaceUrlYesWhere the user reviews, previews and publishes the workspace in Tag Manager.
containerNameYesThe container's name.
containerPathYesAPI path of the container, accounts/{a}/containers/{c}.
workspaceNameYesName of that workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint=true, idempotentHint=true, openWorldHint=true), the description discloses that conditions are replaced wholesale, that the trigger kind is immutable, that changes land in an unpublished draft workspace, and that editing must be enabled on the connection. Those are exactly the consequences an agent needs before invoking a destructive update.

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

Conciseness5/5

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

Front-loaded with the core action, then scope, then the draft/not-published constraint, then the permission prerequisite. No sentence is filler; every clause carries either scope, safety, or prerequisite information.

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 an output schema present, return values need no explanation, and the description covers draft semantics, publishing, permissions and field mutability. It omits failure modes such as an unresolvable trigger or workspace, which would round it out for an 8-parameter mutation tool.

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, but the description adds real meaning: the kind/arguments distinction constrains which parameters are meaningful, and the concrete filter-fix and custom-event examples tie parameters to intent. It still doesn't elaborate on container resolution or the 20-condition cap beyond what the schema says.

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?

"Change one existing trigger of a Google Tag Manager container in a draft workspace" gives a specific verb, resource and scope, and enumerates the mutable facets (conditions, event name, name, notes). The word "existing" plus the note that "the trigger's kind cannot change" separates it from gtm_create_trigger, but no sibling is named explicitly.

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?

Usage context is clear and actionable: fix a Page URL filter that never matches, change a custom event's event name, rename, set notes. It also tells the agent to ask the user which workspace and never choose one itself. It stops short of pointing at an explicit alternative for creating or deleting triggers.

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