gtm_variable
Manage Google Tag Manager variables: create, retrieve, list, update, remove, or revert variables in a container workspace.
Instructions
Performs all GTM variable operations: create, get, list, update, remove, revert. The 'list' action returns up to 20 items per page.
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": {
"action": "<action>",
"accountId": "<accountId>",
"containerId": "<containerId>",
"workspaceId": "<workspaceId>"
},
"name": "gtm_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination (starts from 1). Each page contains up to itemsPerPage items. | |
| action | Yes | The GTM variable operation to perform. Must be one of: 'create', 'get', 'list', 'update', 'remove', 'revert'. | |
| accountId | Yes | The unique ID of the GTM Account containing the variable. | |
| variableId | No | The unique ID of the GTM variable. Required for 'get', 'update', 'remove', and 'revert' actions. | |
| containerId | Yes | The unique ID of the GTM Container containing the variable. | |
| fingerprint | No | The fingerprint for optimistic concurrency control. Optional for 'update' action if included in createOrUpdateConfig. Required for 'revert' action. | |
| workspaceId | Yes | The unique ID of the GTM Workspace containing the variable. | |
| itemsPerPage | No | Number of items to return per page (1-20). Default: 20. Use lower values if experiencing response issues. | |
| createOrUpdateConfig | No | Configuration for 'create' and 'update' actions. All fields correspond to the GTM variable resource, except IDs. |