Tag Manager: Create Version
gtm_create_versionSave the unpublished changes of one Google Tag Manager workspace as a new container version, named by the user. A version is a frozen snapshot: it is NOT live until published (gtm_publish_version, after the user confirms, or the user in Tag Manager). Lists the workspace's pending changes first, refuses an empty workspace or a merge conflict, and reports Google's compiler error when a version could not be built. Hard to reverse: Google consumes the workspace on success (a replacement with the same name is created) and the version stays in the container's history. Requires the Tag Manager connection's versions permission.
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>",
"name": "<name>"
},
"name": "gtm_create_version"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The version name, as the user wants it in Tag Manager's version list, e.g. "GA4 purchase event + Ads conversion fix". | |
| notes | No | Release notes shown on the version. Optional. | |
| container | No | The container: its public id (GTM-XXXXXXX), its name, or its API path from gtm_list_containers. May be left out when the connected login reaches exactly one container. | |
| workspace | Yes | The existing Tag Manager workspace to save the draft in, by name or id, as the user named it (gtm_list_workspaces). Ask the user which workspace to use; never pick one yourself. Nothing is published. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changes | Yes | Those changes, up to 30. | |
| numTags | Yes | Tags in the version. | |
| publicId | No | Public GTM-XXXXXXX id of the container. | |
| published | Yes | Always false: the change is a draft until a version is created and published. | |
| versionId | Yes | Id of the new container version. | |
| versionUrl | No | Where the user reviews the version in Tag Manager. | |
| changeCount | Yes | Changes the workspace held when the version was made. | |
| numTriggers | Yes | Triggers in the version. | |
| versionName | No | Its name. | |
| workspaceId | Yes | Id of the workspace the change was saved in. | |
| numVariables | Yes | Variables in the version. | |
| workspaceUrl | Yes | Where the user reviews, previews and publishes the workspace in Tag Manager. | |
| containerName | Yes | The container's name. | |
| containerPath | Yes | API path of the container, accounts/{a}/containers/{c}. | |
| workspaceName | Yes | Name of that workspace. | |
| newWorkspacePath | No | API path of the replacement workspace Google created, when it gave one. |