Tag Manager: Delete Entity
gtm_delete_entityDelete one user-defined tag, trigger or variable of a Google Tag Manager container from a draft workspace, chosen by entity_type and its id or name. Refused when any tag, trigger or variable in the workspace still references it (the answer lists them), when the workspace's references could not all be checked, and for Google's built-in triggers and variables. To stop a tag firing while keeping it, prefer gtm_update_tag with paused: true. Deleted in the existing workspace the user names (ask which) and NOT published: the live container changes only when a version is created and published. Requires editing to be enabled on the Tag Manager connection. Confirm the entity with the user before calling.
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_type": "<entity_type>",
"entity": "<entity>"
},
"name": "gtm_delete_entity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity | Yes | The entity's id or exact name, as gtm_list_tags or gtm_list_triggers_variables shows it. | |
| 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. | |
| entity_type | Yes | What to delete: tag, trigger or variable. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name the deleted entity had. | |
| deleted | Yes | Always true: the entity is gone from the workspace. | |
| entityId | Yes | Id the deleted entity had inside the container. | |
| 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. | |
| entityType | Yes | tag, trigger or variable. | |
| workspaceId | Yes | Id of the workspace the change was saved in. | |
| 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. |