gtm-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GOOGLE_SCOPES | No | Add so the server knows the profile when using the GOOGLE_* environment variables instead of ~/.gtm-mcp/config.json | |
| MCP_LOG_LEVEL | No | DEBUG / INFO / WARNING — stderr only, never payloads or tokens | |
| REFRESH_TOKEN | No | Google OAuth refresh token; use this instead of ~/.gtm-mcp/config.json (multi-account / CI) | |
| GOOGLE_CLIENT_ID | No | Google OAuth client ID; use this instead of ~/.gtm-mcp/config.json (multi-account / CI) | |
| GTM_MCP_CONFIG_DIR | No | Folder for config.json + audit.jsonl (default ~/.gtm-mcp) | |
| GOOGLE_CLIENT_SECRET | No | Google OAuth client secret; use this instead of ~/.gtm-mcp/config.json (multi-account / CI) | |
| GTM_MCP_AUDIT_DISABLED | No | Set to 1 to turn off the local audit log | |
| GTM_MCP_RATE_LIMIT_QPS | No | Client-side rate in queries per second (default 0.25; 0 disables waiting — tests only) | 0.25 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| gtm_list_accountsA | List every Google Tag Manager account the signed-in Google user can see (1 request). |
| gtm_list_containersA | List containers of one account (1 request), or of all accounts when account_id is omitted (1 request per account, capped at 10 accounts — quota is 25 requests / 100 s). |
| gtm_get_containerB | Container details (name, public id, usage context, domains, linked tag ids). Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. |
| gtm_list_workspacesA | Workspaces of a container (unpublished drafts; free tier allows 3). Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. |
| gtm_get_workspace_statusA | Unpublished changes and merge conflicts of a workspace — run before gtm_create_version. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_list_tagsA | Tags of a workspace with type label, paused flag, trigger ids and key parameters (all pages fetched once; filters/offset are applied locally). type examples: gaawe (GA4 event), googtag, html, awct, ua. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_get_tagA | Full tag: flattened parameters, triggers, consent, notes, fingerprint and the variables it references. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_list_triggersC | Triggers with a one-line condition summary (e.g. 'Custom Event: {{_event}} equals purchase'). Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_get_triggerA | Full trigger with all filter conditions and fingerprint. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_list_variablesA | User-defined variables with a summary (type codes: v = Data Layer, c = Constant, jsm = Custom JS, u = URL, k = Cookie). Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_get_variableA | Full variable with flattened parameters (e.g. Data Layer name, JS code) and fingerprint. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_list_built_in_variablesA | Built-in variables currently enabled in the workspace (type + display name, e.g. pageUrl → 'Page URL'). Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_list_foldersB | Folders of a workspace (tags/triggers/variables reference them via folder_id). Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_list_templatesA | Custom / community-gallery templates installed in the workspace (template code is not returned). Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached). |
| gtm_list_versionsA | Version headers (id, name, entity counts), newest first, plus the latest version id. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. |
| gtm_get_versionA | One version: counts and tags-by-type; include_entities=true adds compact tag/trigger/variable lists. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. |
| gtm_get_live_versionA | The version currently published on the website — what visitors actually get. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. |
| gtm_list_environmentsA | Environments (Live, Latest, custom) with the version each one serves. Preview auth codes are never returned. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. |
| gtm_raw_getA | GET any Tag Manager v2 resource path (starts with 'accounts/…', e.g. accounts/1/containers/2/workspaces/3/clients) for things no dedicated tool covers. Read-only; output is truncated at 50 KB. |
| gtm_auth_statusA | Which scope profile is signed in (read-only vs read+write+publish), API requests made in this session and the client-side rate limiter state. Makes no API call. |
| gtm_find_containerA | Resolve a public id (GTM-XXXXXXX from the website's source, or a linked G-/AW- destination id) to the account, container id and default workspace — 1–2 requests. Or search container names across all accounts (1 request per account). |
| gtm_container_auditA | One-shot health check of a workspace (4–6 requests total — prefer this over many single list calls): UA leftovers, duplicate Google tags, dangling/unused triggers, undefined {{variables}}, placeholder values, GA4 event naming, Custom HTML pixels, paused tags, unpublished changes. Container: GTM-XXXXXXX or accounts//containers/. |
| gtm_check_ga4_ecommerce_coverageA | Which of the 11 GA4 ecommerce events (view_item_list … purchase, refund) have an active GA4 event tag with 'send ecommerce data', which are missing or paused, and which custom-event triggers already exist (3 requests). include_optional_events adds view_promotion, select_promotion, add_to_wishlist. |
| gtm_create_workspaceA | Create a new empty workspace (a draft; nothing is published). Container: GTM-XXXXXXX or accounts//containers/. dry_run=true (default) only previews the request. |
| gtm_create_tagA | Create any tag type in the workspace. |
| gtm_create_ga4_event_tagA | Typed helper for a GA4 event tag (type gaawe). measurement_id = G-XXXXXXXX or a variable reference like
{{GA4 Measurement ID}}. If firing_trigger_ids is omitted, a Custom Event trigger for |
| gtm_update_tagA | Change selected fields of an existing tag (pause/unpause, rename, swap triggers, set parameters). |
| gtm_create_triggerA | Create a trigger. type=customEvent needs custom_event_name (the dataLayer event; use_regex=true for 'a|b'). Other types (pageview, domReady, windowLoaded, click, linkClick, historyChange, scrollDepth…) take optional filters: [{"variable": "{{Page Path}}", "op": "equals|contains|startsWith|endsWith|matchRegex", "value": "/checkout", "negate": false}]. dry_run=true (default) previews only. |
| gtm_create_variableA | Create a user-defined variable. type=dataLayer (code v) needs data_layer_name (e.g. ecommerce.items);
type=constant (code c) needs value; any other GTM type code (jsm, u, k, …) takes raw |
| gtm_enable_built_in_variablesA | Enable built-in variables by API type (pageUrl, pagePath, pageHostname, referrer, event, clickElement, clickClasses, clickId, clickUrl, clickText, formId, scrollDepthThreshold, …). Already-enabled types are harmless. dry_run=true previews. |
| gtm_revert_entityA | Undo this workspace's changes to one tag / trigger / variable / folder: restores the live version's copy, or removes the entity from the workspace if it was created here (the live container is never touched). dry_run=true previews. |
| gtm_create_versionA | Snapshot the workspace into a container version (NOT published yet). GTM deletes the workspace afterwards and creates a fresh default one. Merge conflicts block it — dry_run=true (default) shows the pending changes/conflicts. |
| gtm_publish_versionA | 🔴 Make a container version LIVE for every visitor of the website. Requires |
| gtm_setup_ga4_ecommerce_eventsA | Plan (dry_run=true, default) or apply (dry_run=false) the standard GA4 ecommerce set in a workspace: for every
missing event (view_item_list … purchase, refund; or the |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 34 tools
Each tool is scoped to a distinct resource plus action, and the descriptions actively steer between lookalikes (e.g. gtm_create_ga4_event_tag is called out as the preferred path over gtm_create_tag for GA4 events). The only genuine overlap is in the container-resolution trio (gtm_find_container / gtm_list_containers / gtm_get_container) and between the batch helpers (gtm_container_audit, gtm_setup_ga4_ecommerce_events) and their single-entity counterparts, but each description clarifies when to use which.
Uniform gtm_<verb>_<noun> pattern across all 34 tools, with a consistent split between list_/get_ for reads and create_/update_/publish_/revert_ for writes. No camelCase or ad-hoc verbs leak in.
34 tools is heavy for the interaction surface, driven by a list/get pair for every GTM resource type (tags, triggers, variables, folders, templates, versions, workspaces, environments). Most tools do earn their place, but the convenience wrappers (find_container, container_audit, setup_ga4_ecommerce_events, create_ga4_event_tag) add surface area that could arguably be folded into fewer tools.
Read coverage is excellent and create coverage spans workspaces, tags, triggers, variables, versions and publish. However, writes are asymmetric: only gtm_update_tag exists, with no update for triggers, variables, folders, or containers, and there are no delete operations at all — gtm_revert_entity is only a partial undo, and gtm_raw_get is read-only, so modifying an existing trigger or variable has no clean path.