Skip to main content
Glama
dienhokhanh

gtm-mcp-server

by dienhokhanh

gtm_create_variable

Create a user-defined variable in an explicitly selected Google Tag Manager workspace draft, specifying account, container, workspace, name, and type.

Instructions

Create a user-defined variable in an explicitly selected workspace draft.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDisplay name of the variable.
typeYesGTM variable type, e.g. 'v' (Data Layer), 'c' (Constant), or 'jsm' (Custom JavaScript).
notesNo
accountYesName or ID of the GTM account (e.g. 'My Company' or '1234567').
containerYesName, GTM container ID (publicId, e.g. GTM-XXXX), or internal container ID.
parameterNo
workspaceYesWorkspace name or ID. Required for every mutating operation.
formatValueNo
parentFolderIdNo
enablingTriggerIdNo
disablingTriggerIdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare this as a non-read-only, non-idempotent, open-world mutation that is not destructive. The description adds the meaningful fact that the write targets a workspace draft rather than a live container. It says nothing about duplicate-name behavior (not idempotent), required permissions, or what happens if the workspace does not exist.

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

Conciseness4/5

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

A single front-loaded sentence with no filler and the scope constraint stated immediately. It is arguably too sparse for an 11-parameter mutation, but nothing in it is wasted.

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?

An output schema exists, so return values need no explanation, but for an 11-parameter nested mutation the description supplies no parameter guidance, no prerequisite details (account/container/workspace resolution), and no note on draft-vs-live semantics beyond the word 'draft'. It is materially under-specified for the tool's complexity.

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?

With 11 parameters, nested objects, and only 45% schema description coverage, the description must compensate for the undocumented fields (notes, parameter, formatValue, parentFolderId, enablingTriggerId, disablingTriggerId). It mentions none of them, adding zero semantic value beyond the schema.

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?

States a specific verb ('Create') and resource ('user-defined variable'), and scopes it to a workspace draft, which separates it from gtm_create_tag/gtm_create_trigger and from gtm_update_variable. It does not name a sibling directly, so an agent must infer the boundary, but the purpose itself is unambiguous.

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?

The phrase 'explicitly selected workspace draft' implies the prerequisite context (a workspace must be chosen, and changes land in a draft rather than production), which is useful. However, it never states when to create a variable versus updating an existing one, nor any exclusion or alternative tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.