variables_update
Update a Google Tag Manager variable with a read-modify-write flow that preserves omitted fields and merges parameter entries by key.
Instructions
[WRITE] Update a GTM variable (read-modify-write — omitted fields are preserved; parameter is merged by key). 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>",
"variableId": "<variableId>",
"confirm": "<confirm>"
},
"name": "variables_update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| type | No | ||
| 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}}"}]}]}]. | |
| variableId | Yes | ||
| containerId | Yes | ||
| fingerprint | No | ||
| workspaceId | Yes |