mcp-gtm-audit

v0.2.0
mcp-gtm-audit Checked 4 days ago Published 1 month ago

MCP server for Google Tag Manager: audit containers, validate GA4/Google Ads/Meta tracking, diff workspaces against versions, export importable container JSON…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

gtm_doctor

Check credentials, granted scopes, write mode and API access. Call this first when something fails.

list_accounts

List the GTM accounts visible to the authorized Google user.

list_containers

List the containers of an account, with the numeric containerId the other tools need. Args: account_id: numeric GTM account id.

ParameterTypeDescription
account_id *string

list_workspaces

List the workspaces of a container (id, name, description).

ParameterTypeDescription
account_id *string
container_id *string

list_versions

List the published version headers of a container (id, name, entity counts).

ParameterTypeDescription
account_id *string
container_id *string

list_tags

List the tags of a workspace (default: Default Workspace) with type, paused state and trigger ids.

ParameterTypeDescription
account_id *string
container_id *string
workspace_idstring

list_triggers

List the triggers of a workspace (id, name, type).

ParameterTypeDescription
account_id *string
container_id *string
workspace_idstring

list_variables

List the user-defined variables of a workspace (id, name, type).

ParameterTypeDescription
account_id *string
container_id *string
workspace_idstring

get_entity

Return one tag, trigger, variable or folder in full (parameters, triggers, consent settings). Use it before update_* to see the exact resource shape, and to copy an existing entity as the starting point for a new one. Args: kind: tag, trigger, variable or folder. entity_id: the tagId / triggerId / variableId / folderId.

ParameterTypeDescription
account_id *string
container_id *string
entity_id *string
kind *string
workspace_idstring

gtm_audit

Run the full audit and write an HTML plus a JSON report; returns stats and the file paths. Args: account_id: numeric GTM account id. container_id: numeric container id (not the GTM-XXXX public id). workspace_id: workspace to audit; empty = Default Workspace. use_live_version: audit the published version instead of a workspace. output_dir: where to write; default <reports dir>/<client_slug or container name>/. client_slug: folder name under the reports dir; default = container name. language: en or it, for the report and the issue wor…

ParameterTypeDescription
account_id *string
container_id *string
client_slugstring
languagestring
output_dirstring
use_live_versionboolean
workspace_idstring

gtm_diff

Compare two snapshots: added, removed and modified entities with the fields that changed. Args: base_ref: 'live', a published version id, or 'workspace'. head_ref: 'workspace' (uses workspace_id) or a version id. workspace_id: workspace for 'workspace' refs; empty = Default Workspace.

ParameterTypeDescription
account_id *string
container_id *string
base_refstring
head_refstring
workspace_idstring

gtm_tracking_validation

Map GA4 events per Measurement ID, Google Ads conversions, Meta pixels and server-side hints, with findings.

ParameterTypeDescription
account_id *string
container_id *string
languagestring
use_live_versionboolean
workspace_idstring

gtm_export

Write a container export JSON in GTM's own import format and return its path. The file can be imported from Admin > Import container (merge or overwrite, always into a workspace), which is the safe path when write mode is off. Args: output_path: file to write; default <reports dir>/<container>/gtm-export-<stamp>.json.

ParameterTypeDescription
account_id *string
container_id *string
output_pathstring
use_live_versionboolean
workspace_idstring