Skip to main content
Glama
kLOsk

AdLoop: Google Ads, Reddit Ads & GA4

Draft a Tag Manager tag

draft_gtm_tag

Create or update a Google Tag Manager tag in a workspace and return a preview before publishing. Requires write access; Custom HTML needs explicit permission.

Instructions

Draft creating or updating a Tag Manager tag — returns a PREVIEW.

Without tag_id this creates a tag in a workspace; with tag_id it updates the existing tag. The edit lands in the workspace and changes nothing on the site until the workspace is published. Refused unless gtm.write_enabled is set, and Custom HTML (html) is refused as well unless gtm.allow_custom_html is set. Returns the resolved workspace, the tag type, the fields that would change and a plan_id.

Tag Manager API: https://developers.google.com/tag-platform/tag-manager/api/v2

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoTag name, 1-200 characters. Required when creating a tag.
notesNoFree-form note stored on the tag. None keeps the current note.
pausedNoTrue stores the tag paused instead of deleting it. None keeps the current state.
tag_idNoExisting tag ID to update (see list_gtm_tags). Empty creates a new tag.
tag_typeNoTag type, required when creating a tag because GTM cannot change a tag's type later: googtag, gaawe (GA4 event), awct (Ads conversion), awcc, awud, sp (Ads remarketing), gclidw, flc, fls, img, html (Custom HTML) or cvt_<id> for a Community Gallery template.
parametersNoGTM parameter dicts with at least "type" and "key", for example gaawe [{"type": "TEMPLATE", "key": "eventName", "value": "form_submit"}] or awct [{"type": "TEMPLATE", "key": "conversionId", "value": "123456789"}, {"type": "TEMPLATE", "key": "conversionLabel", "value": "AbC-dEf"}]. On update they merge by key: passed keys replace, other keys stay.
workspace_idNoWorkspace to edit (see list_gtm_workspaces). Empty uses the Default Workspace, or the only workspace there is.
gtm_account_idNoNumeric GTM account ID (see list_gtm_accounts). Empty uses gtm.account_id from the config.
gtm_container_idNoNumeric GTM container ID (see list_gtm_containers). Empty uses gtm.container_id from the config.
firing_trigger_idsNoTrigger IDs that fire the tag (see list_gtm_triggers). The built-in All Pages trigger is "2147479553".
blocking_trigger_idsNoTrigger IDs that must not fire the tag.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.27.1

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations (which only say destructiveHint=false): it discloses that the call returns a PREVIEW, that nothing changes on the live site until the workspace is published, the two feature-flag preconditions that cause refusal, and the exact return payload (workspace, tag type, changed fields, plan_id). This is exactly the extra context annotations cannot carry.

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 preview and create/update rules come first, followed by gating and return contract, with an API doc link last. Every sentence is load-bearing and nothing is padded.

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 preview-oriented draft tool with full annotation coverage, a complete 11-param schema and an output schema, the description supplies everything an agent needs: gating preconditions, mutation scope, and return shape. No gaps remain.

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 each of the 11 parameters is already documented in the schema. The description only adds the tag_id create/update semantics, which is already echoed in the schema, so it does not meaningfully extend parameter meaning. Baseline 3 applies.

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?

States a specific verb+resource ('Draft creating or updating a Tag Manager tag') and immediately pins the scope with the tag_id create-vs-update split. This clearly separates it from sibling draft tools like draft_gtm_trigger, draft_delete_gtm_entity and draft_publish_gtm_workspace.

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

Usage Guidelines4/5

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

Explicitly tells the agent that omitting tag_id creates and supplying tag_id updates, and states the gating conditions (gtm.write_enabled, gtm.allow_custom_html) under which the call is refused. It does not, however, name when to prefer this over sibling drafters, so it stops short of full when/when-not routing.

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

Deploy Server

Other Tools