Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

triggers_update

Update a GTM trigger by changing only specified fields, preserving omitted values and merging parameters by key; requires write access and confirm=true.

Instructions

[WRITE] Update a GTM trigger (read-modify-write — omitted fields are preserved; parameter is merged by key). Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.

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": {
      "accountId": "<accountId>",
      "containerId": "<containerId>",
      "workspaceId": "<workspaceId>",
      "triggerId": "<triggerId>",
      "confirm": "<confirm>"
    },
    "name": "triggers_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
typeNo
limitNoTimer trigger: max fire count as a single Parameter. Top-level GTM field — not in `parameter`.
notesNo
filterNo
confirmYes
intervalNoTimer trigger: firing interval in ms as a single Parameter. Top-level GTM field — not in `parameter`.
accountIdYes
eventNameNoTIMER triggers ONLY: the name of the GTM event the timer fires, as a single Parameter {type:"template", value:"gtm.timer"} (no key). Defaults to gtm.timer when omitted. Do NOT send this for a customEvent trigger: GTM rejects it. A customEvent trigger carries its name in `customEventFilter` as EXACTLY ONE condition, {{_event}} equals <name>, e.g. [{"type":"equals","parameter":[{"type":"template","key":"arg0","value":"{{_event}}"},{"type":"template","key":"arg1","value":"purchase"}]}]. Any further scoping goes in `filter`.
parameterNoGTM parameter list — supports NESTED list/map params. Example (a GA4 event parameter table): [{"type":"list","key":"eventSettingsTable","list":[{"type":"map","map":[{"type":"template","key":"parameter","value":"click_text"},{"type":"template","key":"parameterValue","value":"{{Click Text}}"}]}]}].
triggerIdYes
containerIdYes
fingerprintNo
waitForTagsNoForm/link trigger: plain boolean, or a Parameter object.
workspaceIdYes
autoEventFilterNo
checkValidationNoForm/link trigger: plain boolean, or a Parameter object.
intervalSecondsNoTimer trigger: firing interval in seconds as a single Parameter. Top-level GTM field.
customEventFilterNo
waitForTagsTimeoutNoForm/link trigger: timeout in milliseconds as a plain number, or a Parameter object.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed36 schema fields changedv1.497.5
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / definitions
      Added value: +{
      +  "__schema0": {
      +    "properties": {
      +      "key": {
      +        "description": "Parameter key/name (omit for entries inside a list).",
      +        "type": "string"
      +      },
      +      "list": {
      +        "description": "Child parameters when type=\"list\".",
      +        "items": {
      +          "$ref": "#/definitions/__schema0"
      +        },
      +        "type": "array"
      +      },
      +      "map": {
      +        "description": "Child parameters when type=\"map\".",
      +        "items": {
      +          "$ref": "#/definitions/__schema0"
      +        },
      +        "type": "array"
      +      },
      +      "type": {
      +        "description": "template | integer | boolean | list | map | tagReference | triggerReference | template",
      +        "type": "string"
      +      },
      +      "value": {
      +        "description": "Scalar value (template/integer/boolean/reference). May be a GTM variable like {{Click Text}}.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type"
      +    ],
      +    "type": "object"
      +  }
      +}
    • addedInput schema / properties / accountId / pattern
      Added value: +"^\\d+$"
    • removedInput schema / properties / autoEventFilter / $ref
      Removed value: -"#/properties/filter"
    • addedInput schema / properties / autoEventFilter / items
      Added value: +{
      +  "properties": {
      +    "parameter": {
      +      "description": "EXACTLY TWO entries, keyed arg0 then arg1. Example, a link click on a mailto: address: [{\"type\":\"template\",\"key\":\"arg0\",\"value\":\"{{Click URL}}\"},{\"type\":\"template\",\"key\":\"arg1\",\"value\":\"mailto:\"}] with condition type \"contains\".",
      +      "items": {
      +        "properties": {
      +          "key": {
      +            "description": "MUST be \"arg0\" or \"arg1\" — GTM accepts no other key here, and anything else fails with \"Parameter key is unknown\". arg0 is the LEFT side (the variable being tested), arg1 is the RIGHT side (the value compared against).",
      +            "type": "string"
      +          },
      +          "type": {
      +            "description": "Almost always \"template\".",
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "For arg0, a variable reference in double braces, e.g. \"{{Click URL}}\", \"{{_event}}\", \"{{Page Path}}\". For arg1, the literal to compare, e.g. \"mailto:\". A built-in variable referenced in arg0 must be ENABLED in the workspace first — see built_in_variables_enable (Click URL is \"clickUrl\", Click Text \"clickText\", Form ID \"formId\", and so on).",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "type": {
      +      "description": "Condition type: contains, cssSelector, endsWith, equals, greater, greaterOrEquals, less, lessOrEquals, matchRegex, startsWith, urlMatches.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "parameter"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / autoEventFilter / type
      Added value: +"array"
    • changedInput schema / properties / checkValidation / anyOf
      Previous value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "$ref": "#/properties/eventName"
      -  }
      -]New value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "properties": {
      +      "key": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / containerId / pattern
      Added value: +"^\\d+$"
    • removedInput schema / properties / customEventFilter / $ref
      Removed value: -"#/properties/filter"
    • addedInput schema / properties / customEventFilter / items
      Added value: +{
      +  "properties": {
      +    "parameter": {
      +      "description": "EXACTLY TWO entries, keyed arg0 then arg1. Example, a link click on a mailto: address: [{\"type\":\"template\",\"key\":\"arg0\",\"value\":\"{{Click URL}}\"},{\"type\":\"template\",\"key\":\"arg1\",\"value\":\"mailto:\"}] with condition type \"contains\".",
      +      "items": {
      +        "properties": {
      +          "key": {
      +            "description": "MUST be \"arg0\" or \"arg1\" — GTM accepts no other key here, and anything else fails with \"Parameter key is unknown\". arg0 is the LEFT side (the variable being tested), arg1 is the RIGHT side (the value compared against).",
      +            "type": "string"
      +          },
      +          "type": {
      +            "description": "Almost always \"template\".",
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "For arg0, a variable reference in double braces, e.g. \"{{Click URL}}\", \"{{_event}}\", \"{{Page Path}}\". For arg1, the literal to compare, e.g. \"mailto:\". A built-in variable referenced in arg0 must be ENABLED in the workspace first — see built_in_variables_enable (Click URL is \"clickUrl\", Click Text \"clickText\", Form ID \"formId\", and so on).",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "type": {
      +      "description": "Condition type: contains, cssSelector, endsWith, equals, greater, greaterOrEquals, less, lessOrEquals, matchRegex, startsWith, urlMatches.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "parameter"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / customEventFilter / type
      Added value: +"array"
    • removedInput schema / properties / eventName / additionalProperties
      Removed value: -false
    • addedInput schema / properties / eventName / description
      Added value: +"TIMER triggers ONLY: the name of the GTM event the timer fires, as a single Parameter {type:\"template\", value:\"gtm.timer\"} (no key). Defaults to gtm.timer when omitted. Do NOT send this for a customEvent trigger: GTM rejects it. A customEvent trigger carries its name in `customEventFilter` as EXACTLY ONE condition, {{_event}} equals <name>, e.g. [{\"type\":\"equals\",\"parameter\":[{\"type\":\"template\",\"key\":\"arg0\",\"value\":\"{{_event}}\"},{\"type\":\"template\",\"key\":\"arg1\",\"value\":\"purchase\"}]}]. Any further scoping goes in `filter`."
    • removedInput schema / properties / filter / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / filter / items / properties / parameter / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / interval / $ref
      Removed value: -"#/properties/eventName"
    • addedInput schema / properties / interval / properties
      Added value: +{
      +  "key": {
      +    "type": "string"
      +  },
      +  "type": {
      +    "type": "string"
      +  },
      +  "value": {
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / interval / required
      Added value: +[
      +  "type"
      +]
    • addedInput schema / properties / interval / type
      Added value: +"object"
    • removedInput schema / properties / intervalSeconds / $ref
      Removed value: -"#/properties/eventName"
    • addedInput schema / properties / intervalSeconds / properties
      Added value: +{
      +  "key": {
      +    "type": "string"
      +  },
      +  "type": {
      +    "type": "string"
      +  },
      +  "value": {
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / intervalSeconds / required
      Added value: +[
      +  "type"
      +]
    • addedInput schema / properties / intervalSeconds / type
      Added value: +"object"
    • removedInput schema / properties / limit / $ref
      Removed value: -"#/properties/eventName"
    • addedInput schema / properties / limit / properties
      Added value: +{
      +  "key": {
      +    "type": "string"
      +  },
      +  "type": {
      +    "type": "string"
      +  },
      +  "value": {
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / limit / required
      Added value: +[
      +  "type"
      +]
    • addedInput schema / properties / limit / type
      Added value: +"object"
    • addedInput schema / properties / parameter / items / $ref
      Added value: +"#/definitions/__schema0"
    • removedInput schema / properties / parameter / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / parameter / items / properties
      Removed value: -{
      -  "key": {
      -    "description": "Parameter key/name (omit for entries inside a list).",
      -    "type": "string"
      -  },
      -  "list": {
      -    "description": "Child parameters when type=\"list\".",
      -    "items": {
      -      "$ref": "#/properties/parameter/items"
      -    },
      -    "type": "array"
      -  },
      -  "map": {
      -    "description": "Child parameters when type=\"map\".",
      -    "items": {
      -      "$ref": "#/properties/parameter/items"
      -    },
      -    "type": "array"
      -  },
      -  "type": {
      -    "description": "template | integer | boolean | list | map | tagReference | triggerReference | template",
      -    "type": "string"
      -  },
      -  "value": {
      -    "description": "Scalar value (template/integer/boolean/reference). May be a GTM variable like {{Click Text}}.",
      -    "type": "string"
      -  }
      -}
    • removedInput schema / properties / parameter / items / required
      Removed value: -[
      -  "type"
      -]
    • removedInput schema / properties / parameter / items / type
      Removed value: -"object"
    • addedInput schema / properties / triggerId / pattern
      Added value: +"^\\d+$"
    • changedInput schema / properties / waitForTags / anyOf
      Previous value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "$ref": "#/properties/eventName"
      -  }
      -]New value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "properties": {
      +      "key": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / waitForTagsTimeout / anyOf
      Previous value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "$ref": "#/properties/eventName"
      -  }
      -]New value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "properties": {
      +      "key": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / workspaceId / pattern
      Added value: +"^\\d+$"
  2. Changed13 schema fields changedv1.473.4
    • removedInput schema / properties / checkValidation / $ref
      Removed value: -"#/properties/eventName"
    • addedInput schema / properties / checkValidation / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "$ref": "#/properties/eventName"
      +  }
      +]
    • addedInput schema / properties / checkValidation / description
      Added value: +"Form/link trigger: plain boolean, or a Parameter object."
    • addedInput schema / properties / filter / items / properties / parameter / description
      Added value: +"EXACTLY TWO entries, keyed arg0 then arg1. Example, a link click on a mailto: address: [{\"type\":\"template\",\"key\":\"arg0\",\"value\":\"{{Click URL}}\"},{\"type\":\"template\",\"key\":\"arg1\",\"value\":\"mailto:\"}] with condition type \"contains\"."
    • addedInput schema / properties / filter / items / properties / parameter / items / properties / key / description
      Added value: +"MUST be \"arg0\" or \"arg1\" — GTM accepts no other key here, and anything else fails with \"Parameter key is unknown\". arg0 is the LEFT side (the variable being tested), arg1 is the RIGHT side (the value compared against)."
    • addedInput schema / properties / filter / items / properties / parameter / items / properties / type / description
      Added value: +"Almost always \"template\"."
    • addedInput schema / properties / filter / items / properties / parameter / items / properties / value / description
      Added value: +"For arg0, a variable reference in double braces, e.g. \"{{Click URL}}\", \"{{_event}}\", \"{{Page Path}}\". For arg1, the literal to compare, e.g. \"mailto:\". A built-in variable referenced in arg0 must be ENABLED in the workspace first — see built_in_variables_enable (Click URL is \"clickUrl\", Click Text \"clickText\", Form ID \"formId\", and so on)."
    • removedInput schema / properties / waitForTags / $ref
      Removed value: -"#/properties/eventName"
    • addedInput schema / properties / waitForTags / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "$ref": "#/properties/eventName"
      +  }
      +]
    • addedInput schema / properties / waitForTags / description
      Added value: +"Form/link trigger: plain boolean, or a Parameter object."
    • removedInput schema / properties / waitForTagsTimeout / $ref
      Removed value: -"#/properties/eventName"
    • addedInput schema / properties / waitForTagsTimeout / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "$ref": "#/properties/eventName"
      +  }
      +]
    • addedInput schema / properties / waitForTagsTimeout / description
      Added value: +"Form/link trigger: timeout in milliseconds as a plain number, or a Parameter object."
  3. Addedv1.421.0
  4. Removedv1.350.0
  5. Changed3 schema fields changedv1.263.0
    • addedInput schema / properties / interval
      Added value: +{
      +  "$ref": "#/properties/eventName",
      +  "description": "Timer trigger: firing interval in ms as a single Parameter. Top-level GTM field — not in `parameter`."
      +}
    • addedInput schema / properties / intervalSeconds
      Added value: +{
      +  "$ref": "#/properties/eventName",
      +  "description": "Timer trigger: firing interval in seconds as a single Parameter. Top-level GTM field."
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "$ref": "#/properties/eventName",
      +  "description": "Timer trigger: max fire count as a single Parameter. Top-level GTM field — not in `parameter`."
      +}
  6. Changed5 schema fields changedv1.35.1
    • addedInput schema / properties / autoEventFilter
      Added value: +{
      +  "$ref": "#/properties/filter"
      +}
    • addedInput schema / properties / checkValidation
      Added value: +{
      +  "$ref": "#/properties/eventName"
      +}
    • addedInput schema / properties / parameter
      Added value: +{
      +  "description": "GTM parameter list — supports NESTED list/map params. Example (a GA4 event parameter table): [{\"type\":\"list\",\"key\":\"eventSettingsTable\",\"list\":[{\"type\":\"map\",\"map\":[{\"type\":\"template\",\"key\":\"parameter\",\"value\":\"click_text\"},{\"type\":\"template\",\"key\":\"parameterValue\",\"value\":\"{{Click Text}}\"}]}]}].",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "key": {
      +        "description": "Parameter key/name (omit for entries inside a list).",
      +        "type": "string"
      +      },
      +      "list": {
      +        "description": "Child parameters when type=\"list\".",
      +        "items": {
      +          "$ref": "#/properties/parameter/items"
      +        },
      +        "type": "array"
      +      },
      +      "map": {
      +        "description": "Child parameters when type=\"map\".",
      +        "items": {
      +          "$ref": "#/properties/parameter/items"
      +        },
      +        "type": "array"
      +      },
      +      "type": {
      +        "description": "template | integer | boolean | list | map | tagReference | triggerReference | template",
      +        "type": "string"
      +      },
      +      "value": {
      +        "description": "Scalar value (template/integer/boolean/reference). May be a GTM variable like {{Click Text}}.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / waitForTags
      Added value: +{
      +  "$ref": "#/properties/eventName"
      +}
    • addedInput schema / properties / waitForTagsTimeout
      Added value: +{
      +  "$ref": "#/properties/eventName"
      +}
  7. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does a good job on the highest-risk trait: it discloses that omitted fields are preserved and that `parameter` is merged by key, which prevents an agent from accidentally wiping configuration with a partial payload. It still omits whether the update is reversible, whether a new container version is created (requiring a publish step), or how `fingerprint` affects concurrent edits.

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?

A single front-loaded sentence with the write marker first, then the scope-critical merge semantics, then the permission gate. Every clause earns its place and there is no filler.

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?

For a 20-parameter mutation tool with nested objects and no annotations, the description covers the two things an agent most needs — write gating and partial-update semantics. But with no output schema it should say what an update returns (and whether a version/publish step follows), and it leaves the required identifier set and `fingerprint` handling entirely to the schema.

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 40%, but the schema itself is unusually rich — nested filter/customEventFilter arg0/arg1 rules, timer-field exclusivity, and nested parameter examples are all documented inline. The description's only added semantic is the merge behavior of `parameter`, which is genuinely non-obvious and useful, but it says nothing about the 5 required ID parameters or `fingerprint`. Baseline plus one real contribution puts it at 3.

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 opens with a bracketed [WRITE] tag and a concrete verb+resource: 'Update a GTM trigger'. That is unambiguous against the sibling set (triggers_create, triggers_get, triggers_list, triggers_delete) without needing to name them. It stops short of an explicit sibling contrast, so it lands at 4 rather than 5.

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?

It supplies real preconditions — GTM_MCP_ENABLE_WRITES=true and confirm=true — which tell the agent when the call is even permitted. However, it gives no guidance on the read-modify-write workflow itself (e.g. fetch the current trigger via triggers_get first) and no when-not or alternative routing versus triggers_create. Usage is implied by the mutation framing, not stated.

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