Google Tag Manager MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GOOGLE_TAGMANAGER_API_BASE | No | API root override | https://tagmanager.googleapis.com |
| GOOGLE_TAGMANAGER_CLIENT_ID | No | OAuth client id | |
| GOOGLE_TAGMANAGER_TIMEOUT_MS | No | Per-request timeout | 60000 |
| GOOGLE_TAGMANAGER_MAX_RETRIES | No | Retries on transient errors | 3 |
| GOOGLE_TAGMANAGER_ACCESS_TOKEN | No | Ready-made access token; replaces the trio for quick sessions | |
| GOOGLE_TAGMANAGER_CLIENT_SECRET | No | OAuth client secret | |
| GOOGLE_TAGMANAGER_REFRESH_TOKEN | No | OAuth refresh token | |
| GOOGLE_TAGMANAGER_MIN_INTERVAL_MS | No | Minimum spacing between API requests (0.25 QPS quota) | 4200 |
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": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_accountsA | Lists all Google Tag Manager accounts the authorized user can access. Returns { account: [{ accountId, name, path, fingerprint }], nextPageToken }. All ids are strings. This is the entry point: every other tool needs an accountId (or a path) from here. |
| get_accountA | Gets one Google Tag Manager account by id. Returns the Account resource: { accountId, name, path, fingerprint, shareData }. |
| list_containersA | Lists the containers of a GTM account. Returns { container: [{ containerId, name, publicId (e.g. GTM-XXXXXX), usageContext, path, fingerprint, tagManagerUrl }], nextPageToken }. |
| get_containerA | Gets one container by account id + container id. Returns the Container resource including publicId (the GTM-XXXXXX snippet id), usageContext and fingerprint. |
| create_containerA | Creates a new container in a GTM account. usage_context declares the platform, e.g. ["web"]; other values include androidSdk5, iosSdk5, server. Returns the created Container with its server-assigned containerId and publicId. Requires the tagmanager.edit.containers scope. |
| list_workspacesA | Lists the workspaces of a container. Returns { workspace: [{ workspaceId, name, description, path, fingerprint }], nextPageToken }. Workspaces are mandatory in GTM v2: every tag/trigger/variable operation needs a workspaceId, and a "Default Workspace" always exists — call this first. |
| get_workspaceA | Gets one workspace by account id + container id + workspace id. Returns the Workspace resource with its fingerprint. |
| create_workspaceA | Creates a new workspace in a container — an isolated draft where tags, triggers and variables are edited before being compiled into a version. Returns the created Workspace with its server-assigned workspaceId. Requires the tagmanager.edit.containers scope. |
| list_tagsA | Lists the tags of a workspace. Returns { tag: [{ tagId, name, type (e.g. html, gaawe), parameter: [{ type, key, value, list, map }], firingTriggerId, blockingTriggerId, paused, path, fingerprint, tagManagerUrl }], nextPageToken }. |
| list_triggersA | Lists the triggers of a workspace. Returns { trigger: [{ triggerId, name, type (e.g. pageview, click, customEvent), filter/customEventFilter (conditions of { type, parameter }), path, fingerprint }], nextPageToken }. |
| list_variablesA | Lists the user-defined variables of a workspace (built-in variables live in manage_built_in_variables). Returns { variable: [{ variableId, name, type (e.g. v = data layer, jsm = custom JS, c = constant), parameter, path, fingerprint }], nextPageToken }. |
| get_resourceA | Generic getter for any GTM resource by its API-relative path — tags, triggers, variables, versions, containers, workspaces. Prefer echoing the |
| create_entityA | Creates a tag, trigger or variable in a workspace. |
| update_entityA | Updates a tag, trigger or variable by its API path. PUT semantics: this is a FULL REPLACE, not a patch — fetch the current resource with get_resource, modify it, and send the whole object back. Pass the resource's last-seen fingerprint for optimistic-concurrency safety; a mismatch fails the request. Requires the tagmanager.edit.containers scope. |
| delete_entityA | Deletes a tag, trigger or variable by its API path. The response is empty on success. Requires the tagmanager.edit.containers scope. |
| manage_built_in_variablesA | Manages a workspace's built-in variables (pageUrl, clickText, event, ...). These are toggles, not records: action "list" returns the currently enabled ones ({ builtInVariable: [...] }), "enable" and "disable" take |
| create_versionA | Compiles a workspace into an immutable Container Version (the unit that gets published). SIDE EFFECT: the source workspace is DELETED and replaced by a fresh one — the response's newWorkspacePath points to the replacement; use it for any further edits, or old workspace paths will 404. Returns { containerVersion (with containerVersionId and full tag/trigger/variable snapshots), syncStatus, newWorkspacePath }. A compile failure comes back as compilerError=true with HTTP 200 and is reported as an error. Requires the tagmanager.edit.containerversions scope (edit.containers is NOT sufficient). |
| publish_versionA | Container-version operations. action "publish" pushes a version live (replacing the currently published one; requires the tagmanager.publish scope; version_id required, fingerprint recommended). action "get" fetches one version by version_id. action "live" fetches the currently published version of the container (no version_id needed). Publish responses can carry compilerError=true with HTTP 200 — reported as an error. Returns the ContainerVersion (publish wraps it as { containerVersion, compilerError }). |
| raw_requestA | Escape hatch to call any Google Tag Manager API v2 path directly, for endpoints without a dedicated tool (environments, folders, templates, zones, workspace :sync / :quick_preview, version_headers, ...). |
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 19 tools
Most tools target distinct resources or actions clearly. The generic get_resource and create_entity/update_entity/delete_entity are broad but their descriptions clarify which resource types they apply to. publish_version with multiple actions (publish, get, live) overlaps slightly with get_resource, but this is manageable.
The dominant pattern is verb_noun (list_accounts, get_container, create_workspace, update_entity, delete_entity). Deviations include manage_built_in_variables, publish_version, and raw_request, which break the clean pattern but remain understandable. The generic entity suffix is less specific than named resources but consistent across create/update/delete.
With 19 tools covering accounts, containers, workspaces, entities, versions, and a raw escape hatch, the count is higher than average but justified by GTM's broad API surface. The set feels comprehensive without being bloated, and the raw_request tool reduces the need for many specialized tools.
Core workflows are covered: accounts, containers, workspaces, entity CRUD, version creation, and publishing. Some operations lack dedicated tools (update/delete container, workspace update/delete, version listing), but raw_request fills these gaps. The main tag management lifecycle is fully supported, with minor workarounds needed for edge cases.