Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

variables_create

Creates a Google Tag Manager variable in a specified account, container, and workspace, with optional parameters and folder/trigger settings; requires writes enabled and confirm=true.

Instructions

[WRITE] Create a GTM variable. 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>",
      "name": "<name>",
      "type": "<type>",
      "confirm": "<confirm>"
    },
    "name": "variables_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesVariable name.
typeYesVariable type (e.g. "v" for data layer, "k" for first-party cookie, "u" for URL, "c" for constant, "jsm" for custom JS, "smm" for lookup table, "gas" for GA settings).
notesNo
confirmYes
accountIdYes
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}}"}]}]}].
containerIdYes
workspaceIdYes
parentFolderIdNo
enablingTriggerIdNo
disablingTriggerIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 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+$"
    • addedInput schema / properties / containerId / pattern
      Added value: +"^\\d+$"
    • 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 / workspaceId / pattern
      Added value: +"^\\d+$"
  2. Addedv1.421.0
  3. Removedv1.350.0
  4. Changed6 schema fields changedv1.35.1
    • addedInput schema / properties / parameter / description
      Added value: +"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}}\"}]}]}]."
    • addedInput schema / properties / parameter / items / properties / key / description
      Added value: +"Parameter key/name (omit for entries inside a list)."
    • addedInput schema / properties / parameter / items / properties / list
      Added value: +{
      +  "description": "Child parameters when type=\"list\".",
      +  "items": {
      +    "$ref": "#/properties/parameter/items"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / parameter / items / properties / map
      Added value: +{
      +  "description": "Child parameters when type=\"map\".",
      +  "items": {
      +    "$ref": "#/properties/parameter/items"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / parameter / items / properties / type / description
      Added value: +"template | integer | boolean | list | map | tagReference | triggerReference | template"
    • addedInput schema / properties / parameter / items / properties / value / description
      Added value: +"Scalar value (template/integer/boolean/reference). May be a GTM variable like {{Click Text}}."
  5. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden; it does disclose that this is a gated write requiring an environment flag and an explicit confirm flag, which is valuable beyond what the schema shows. It stops short of saying what the write mutates, whether the new variable lands in a draft workspace, or what happens when the confirm/flag precondition fails.

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?

Two sentences, write-mode tag and action first, preconditions second — every clause earns its place with no filler. The terse form suits a short definition and nothing is buried.

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

Completeness2/5

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

This is a high-arity mutation tool (11 params, 6 required) with no annotations, no output schema, and sparse schema descriptions, so the description should do far more. An agent still lacks guidance on workspace/folder scoping, trigger binding, and the parameter structure needed for a correct call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 27% across 11 parameters, so the description needed to compensate and does not. Its only parameter-level contribution is the confirm=true requirement; accountId, containerId, workspaceId, notes, parentFolderId, enablingTriggerId and disablingTriggerId remain unexplained in both places.

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 gives a specific verb+resource ("Create a GTM variable") and prefixes it with [WRITE], so an agent immediately knows the operation class. It does not distinguish itself from plausible siblings such as create_gtm_variable_typed or variables_update, leaving the agent to infer the split from names alone.

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 states two hard preconditions (GTM_MCP_ENABLE_WRITES=true and confirm=true), which is genuine when-to-use guidance. However it never says when to prefer this over the typed-variable sibling or variables_update, so the alternative-selection guidance is only implied by the tool name.

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