Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

create_server_tag

Creates a native Google tag in a GTM server container workspace for GA4 event relay, Ads conversion, Conversion Linker, or remarketing, and assigns server firing triggers.

Instructions

[WRITE] Create a NATIVE Google server tag in a SERVER container workspace, built with the correct shape: platform "ga4" = the GA4 relay (sgtmgaaw; omit eventName to relay every incoming event, pass one for a per-event tag; optional eventParameters / userProperties enrichment rows), "ads_conversion" = Google Ads conversion (sgtmadsct; conversionId + conversionLabel), "ads_conversion_linker" = the server Conversion Linker (sgtmadscl), "ads_remarketing" = Google Ads remarketing (sgtmadsremarket; conversionId). Pass the SERVER trigger id(s) as firingTriggerId. 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>",
      "platform": "<platform>",
      "confirm": "<confirm>"
    },
    "name": "create_server_tag"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesTag name.
confirmYesMust be true to confirm this write operation.
platformYes
accountIdYesGTM account ID.
eventNameNoFor ga4: a literal event name for a per-event tag; omit to relay every event.
containerIdYesThe SERVER container ID (for the plan tool: the WEB container).
workspaceIdYesWorkspace ID.
conversionIdNoFor ads_conversion / ads_remarketing: the Ads Conversion ID (AW- prefix is stripped).
measurementIdNoFor ga4: the G- Measurement ID or a {{variable}}.
userPropertiesNoOverride rows {name, value}; names are the template's own field keys.
conversionLabelNoFor ads_conversion: the Conversion Label.
eventParametersNoOverride rows {name, value}; names are the template's own field keys.
firingTriggerIdNoSERVER trigger id(s) the tag fires on (triggers_create, type customEvent). Usually one.
productReportingNoFor ads_conversion: enable product reporting (ecommerce only).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.497.5

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations present, the definition does carry the important write-side context: a [WRITE] marker, the environment flag, and the confirm=true gate, which together warn that this mutates a workspace. Beyond that it discloses little about behavior — no return value, no note on duplicate tags, no statement of whether the created tag is enabled or paused by default.

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 verb and scope, then a compact platform-by-platform breakdown in a single structured sentence. Dense but every clause carries information an agent needs to pick the right platform and fields; nothing is redundant.

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 14-parameter, 4-variant creation tool with no output schema and no annotations, the definition covers the decision-critical surface (platform choice, required per-platform fields, trigger wiring, write gating). Minor gaps remain around defaults for optional fields and what the tool returns on success.

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 already 93%, but the description still adds real meaning: it maps each platform enum value to its native template and required fields (conversionId + conversionLabel, GA4 relay semantics, linker/remarketing), and it clarifies that firingTriggerId takes SERVER trigger ids from triggers_create. Optional params like measurementId and productReporting are left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Create a NATIVE Google server tag in a SERVER container workspace") and enumerates the four platform variants with their underlying template ids, which lets an agent distinguish this from the sibling CAPI tag creators (meta, tiktok, adroll, etc.) that all share the create_*_server_tag pattern.

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?

Gives clear per-platform selection guidance (which platform value produces which tag shape, and when to pass eventName) plus hard prerequisites: GTM_MCP_ENABLE_WRITES=true and confirm=true. It does not explicitly state when to use a sibling such as create_gtm_tracking_tag (web) or the CAPI tag creators instead, so no explicit exclusions are offered.

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