gtm_upsert
Create or update any Google Tag Manager tag, trigger, or variable from raw GTM API resource JSON. Pass an ID to update an existing resource; omit it to create a new one.
Instructions
Advanced: create or update any tag, trigger or variable using the raw GTM API resource JSON (e.g. Custom HTML tags, Meta/Google Ads tags, click or form triggers, lookup tables). With id → update; without → create.
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": {
"workspace": "<workspace>",
"entity": "<entity>",
"resource": "<resource>"
},
"name": "gtm_upsert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| entity | Yes | ||
| resource | Yes | Tag/Trigger/Variable body: name, type, parameter[], firingTriggerId[], filter[], customEventFilter[] … | |
| workspace | Yes | Workspace path (accounts/…/containers/…/workspaces/…), or a container public ID like GTM-XXXX (uses its Default Workspace) |