Skip to main content
Glama

Google Ads & Meta Ads

Tag Manager: Delete Entity

gtm_delete_entity
DestructiveIdempotent

Delete 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

NameRequiredDescriptionDefault
entityYesThe entity's id or exact name, as gtm_list_tags or gtm_list_triggers_variables shows it.
containerNoThe 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.
workspaceYesThe 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_typeYesWhat to delete: tag, trigger or variable.

Output Schema

NameRequiredDescriptionDefault
nameYesName the deleted entity had.
deletedYesAlways true: the entity is gone from the workspace.
entityIdYesId the deleted entity had inside the container.
publicIdNoPublic GTM-XXXXXXX id of the container.
publishedYesAlways false: the change is a draft until a version is created and published.
entityTypeYestag, trigger or variable.
workspaceIdYesId of the workspace the change was saved in.
workspaceUrlYesWhere the user reviews, previews and publishes the workspace in Tag Manager.
containerNameYesThe container's name.
containerPathYesAPI path of the container, accounts/{a}/containers/{c}.
workspaceNameYesName of that workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description discloses important behavior: reference checks and built-in entities block deletion, the answer lists references, workspace editing must be enabled, and the live container changes only after version creation and publishing. This gives an agent the side effects and prerequisites needed for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and scope are front-loaded, followed by refusal conditions, an alternative, publication behavior, authentication requirements, and confirmation guidance. The length is justified for a destructive tool and no sentence is expendable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, permission-sensitive tool with a rich schema and output schema, the description covers purpose, alternatives, refusal cases, side effects, and required user confirmation. An agent has enough information to decide whether and how to call it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents entity, container, workspace, and entity_type in detail. The description reinforces that the entity is chosen by type and id or name, but adds little parameter-level meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: deleting one user-defined tag, trigger, or variable from a draft GTM workspace. It clearly distinguishes the operation from updating a tag with paused: true and from deleting built-in entities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says when deletion is refused, names the alternative for keeping a tag while stopping it from firing, and explains that deletion affects only the draft workspace unless published. It also instructs the agent to confirm the entity with the user before calling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources