Connect the Google Tag Manager MCP server to your AI agent Open source, MIT, on npm. Setup instructions for Claude, Cursor and Codex are in the repository; adoption questions — Telegram. GitHub repository Telegram

Google Tag Manager: List/enable/disable built-in variables — MCP tool

Google Tag Manager MCP tool: Manages a workspace's built-in variables (pageUrl, clickText, event, ...).

Technical name: manage_built_in_variables

What task it solves

I want to manage built-in variables.

Manages a workspace's built-in variables (pageUrl, clickText, event, ...).

When to use it

Use this capability when you need “List/enable/disable built-in variables” without doing the same work manually in the Google Tag Manager interface. It runs only when an AI client calls it.

What to provide

  • account_idrequired. GTM account id (string).
  • container_idrequired. Container id (string).
  • workspace_idrequired. Workspace id (string).
  • actionrequired. What to do.
  • typesoptional. Built-in variable types to enable/disable (required for those actions), e.g. ["pageUrl", "clickText"]. Ignored for "list".

What it returns

Returns compact JSON from the upstream API or a clear MCP tool error. The exact fields depend on the operation and are documented in the technical reference.

What changes in Google Tag Manager

The tool changes real Google Tag Manager data as described above. The server does not promise an automatic rollback.

Example request

List/enable/disable built-in variables in Google Tag Manager. Ask for any required identifiers that are missing.

Errors and limitations

These are toggles, not records: action "list" returns the currently enabled ones ({ builtInVariable: [...] }), "enable" and "disable" take types (BuiltInVariableType enum values) and switch them on/off. Enable/disable require the tagmanager.edit.containers scope.

Access also depends on token permissions, quotas, and upstream API limits.

Related MCP tools

There are no other dedicated tools in this group.

Technical details