variables_create
Creates a new GTM variable with specified name, type, and parameters. Requires confirmation and write mode enabled.
Instructions
[WRITE] Create a GTM variable. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Variable name. | |
| type | Yes | Variable 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). | |
| notes | No | ||
| confirm | Yes | ||
| accountId | Yes | ||
| parameter | No | 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}}"}]}]}]. | |
| containerId | Yes | ||
| workspaceId | Yes | ||
| parentFolderId | No | ||
| enablingTriggerId | No | ||
| disablingTriggerId | No |