Skip to main content
Glama

Create variable (🟡 write)

gtm_create_variable

Create a user-defined Google Tag Manager variable, including dataLayer, constant, or custom parameter types, with dry-run preview before applying changes.

Instructions

Create a user-defined variable. type=dataLayer (code v) needs data_layer_name (e.g. ecommerce.items); type=constant (code c) needs value; any other GTM type code (jsm, u, k, …) takes raw parameters. dry_run=true (default) previews only.

Input Schema

NameRequiredDescriptionDefault
nameYes
typeNodataLayer
valueNo
dry_runNo
containerYes
parametersNo
workspace_idNo
default_valueNo
data_layer_nameNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare write, non-destructive, non-idempotent; the description adds the important piece beyond them — dry_run=true (default) previews only — which tells the agent the default call performs no write. It doesn't disclose undo semantics or that the variable lands in a workspace draft, but the safety-critical behavior is covered.

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?

Three dense, front-loaded lines with no filler, leading with what is created and following with the type-specific rules. Slightly cryptic in places ("code v", "raw parameters") but nothing is wasted.

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 9-parameter write tool with an output schema, the description covers the dry-run safety model and the type-dependent required fields, which are the two things an agent could get wrong. Gaps around container/workspace placement and default_value are the remaining shortfall.

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 0% across 9 parameters, so the description had to compensate, and it does for type, value, data_layer_name, parameters and dry_run, including the non-obvious mapping of GTM type codes (v, c, jsm, u, k) to required fields. name, container, workspace_id and default_value remain undocumented in both places, which keeps it from a 5.

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 and resource ("Create a user-defined variable") which is distinct from the list/get siblings. It does not name a near-alternative such as gtm_create_tag or gtm_update_tag, but the resource is unambiguous enough that an agent can route to it.

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 description gives type-conditioned guidance (which field each type requires) which implies usage, but never states when to choose this over the sibling creators or what container/workspace context is assumed. Usage is inferable rather than stated.

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