Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

templates_create

Creates a new Google Tag Manager template from a full JSON resource; requires account, container, and workspace IDs plus write confirmation.

Instructions

[WRITE] Create a new GTM template. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true. Pass the full resource as a JSON string in bodyJson.

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>",
      "bodyJson": "<bodyJson>",
      "confirm": "<confirm>"
    },
    "name": "templates_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmYesMust be true to confirm this write operation.
bodyJsonYesFull templates resource as a JSON string (e.g. {"name":"...","type":"..."}).
accountIdYesThe GTM account ID.
containerIdYesThe GTM container ID.
workspaceIdYesThe GTM workspace ID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.497.5
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / accountId / pattern
      Added value: +"^\\d+$"
    • addedInput schema / properties / containerId / pattern
      Added value: +"^\\d+$"
    • addedInput schema / properties / workspaceId / pattern
      Added value: +"^\\d+$"
  2. Addedv1.421.0
  3. Removedv1.350.0
  4. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden. It does disclose the write-gate behavior (env flag plus confirm) that governs whether the call is even permitted, which is meaningful operational context. It says nothing about what the call returns, whether a workspace must be in a particular state, or what happens on validation failure of bodyJson.

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?

Three short sentences, each earning its place: the write tag and core action first, then the gating preconditions, then the body format pointer. No filler and the most decision-relevant information is front-loaded.

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?

For a five-required-parameter mutation with no annotations and no output schema, the description covers the action, the permission gate, and the payload shape, which is most of what an agent needs. It leaves the return value and any post-creation side effects unstated, a minor gap given the tool's straightforward nature.

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 all five parameters are already documented in the schema. The description restates that the full resource goes in bodyJson as a JSON string, adding no new meaning about which fields are required or what a valid template resource looks like beyond the schema's own example hint.

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 states a specific verb and resource ("Create a new GTM template") and the [WRITE] prefix flags the mutation class immediately, which separates it from read siblings like templates_get and templates_list. It does not explicitly distinguish it from templates_import_from_gallery or templates_update, so it stops short of a 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 gives a concrete precondition (GTM_MCP_ENABLE_WRITES=true and confirm=true) that an agent must satisfy before calling, which is real usage guidance. However there is no guidance on when to create from scratch versus importing from the gallery or updating an existing template, so the alternative-selection question is left implicit.

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