google-data-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GOOGLE_DATA_MCP_ENV | No | Path to the env file containing credentials. Credentials are read in this order: process environment, file in $GOOGLE_DATA_MCP_ENV, ~/.config/google-data-mcp/.env, .env next to index.mjs. | |
| GOOGLE_DATA_MCP_READONLY | No | Set to 1 to hide every write tool and force the read-only token. | |
| GOOGLE_DATA_MCP_BACKUP_DIR | No | Override the backup directory; default is ~/.config/google-data-mcp/backups. | |
| GOOGLE_DATA_MCP_MAX_OUTPUT | No | Change the response truncation threshold; default is 50,000 characters. | |
| GOOGLE_OAUTH_REFRESH_TOKEN | No | Read-only OAuth refresh token with the analytics.readonly and tagmanager.readonly scopes. | |
| GOOGLE_OAUTH_REFRESH_TOKEN_WRITE | No | OAuth refresh token with the read-only scopes plus analytics.edit, tagmanager.edit.containers, tagmanager.edit.containerversions and tagmanager.publish. If present it is used for everything; otherwise write tools fail with a clear scope hint. |
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 |
|---|---|
| ga4_list_propertiesA | Lists all Google Analytics 4 properties the account can access (name + numeric property ID). You need the ID for ga4_run_report / ga4_realtime_report. |
| ga4_run_reportB | GA4 core report (Data API runReport). Example metrics: sessions, totalUsers, newUsers, screenPageViews, conversions, engagementRate, averageSessionDuration, bounceRate. Example dimensions: date, pagePath, pageTitle, sessionDefaultChannelGroup, sessionSource, sessionMedium, country, deviceCategory, landingPage. |
| ga4_realtime_reportA | GA4 realtime report (runRealtimeReport, last ~30 min). metrics e.g. ['activeUsers']; dimensions e.g. ['unifiedScreenName','country','deviceCategory']. |
| gtm_list_accountsA | Lists all Google Tag Manager accounts and their containers (publicId GTM-XXXX, numeric containerId, web/server). You need accountId + containerId for gtm_export_container. |
| gtm_export_containerA | Reads the currently published (live) version of a GTM container: overview of all tags, triggers and variables — ideal for tracking audits. Requires accountId and containerId (from gtm_list_accounts). With containerVersionId, an older version (from gtm_list_versions) instead, e.g. before a rollback. |
| google_token_infoA | Shows which refresh token is active (write / read-only) and which OAuth scopes it has — first check when a write tool fails with 403. |
| ga4_list_data_streamsB | Lists the data streams of a property (web streams with measurement ID G-XXXX and URL). |
| ga4_list_key_eventsB | Lists the events of a property marked as key events (formerly conversions). |
| ga4_list_custom_definitionsC | Lists all custom dimensions and custom metrics of a property. |
| gtm_list_workspacesA | Lists the workspaces of a container. You need workspaceId for all GTM write tools. |
| gtm_workspace_statusA | Shows the changes and conflicts of a workspace compared to the live version — compact (kind of change, type, ID, name). Check before gtm_create_version. full=true returns the complete entities incl. code. |
| gtm_list_entitiesA | Returns the complete JSON objects (incl. parameter, fingerprint) of an entity type in the workspace — template for changing via gtm_save_entity. |
| ga4_export_configA | Backs up the complete configuration of a property (settings, data streams incl. enhanced measurement, key events, custom dimensions/metrics, data retention, links) as a local JSON file. GA4 has no versions — this is the state to restore from. Read the content via backup_read. |
| ga4_change_historyB | Who changed what on the property and when (including in the GA4 UI), incl. state before/after. Times as RFC3339, e.g. '2026-09-01T00:00:00Z'. Further pages via pageToken. |
| gtm_export_workspaceA | Backs up a complete workspace (all tags, triggers, variables, folders, templates, built-in variables) as a local JSON file — including unsaved changes that GTM itself does not version yet. |
| gtm_export_versionA | Backs up a container version (default: the live version) completely as a local JSON file. |
| backup_listA | Lists the local snapshots (newest first). id = GA4 property ID or GTM '-'. |
| backup_readA | Reads a snapshot (path from backup_list or the backup field of a write action) — basis for comparison or restoring. |
| gtm_quick_previewA | Compiles the workspace as a trial, without a version and without publishing anything. Returns only compilerError + number of tags/triggers/variables. On compilerError it searches for the cause itself (likelyCauses). |
| gtm_validate_workspaceA | Checks all tags, triggers and variables in the workspace: JavaScript in Custom HTML/Custom JS (ES5 strict, incl. functions in blocks) and whether every {{Variable}} exists. Returns name, ID, line and column per problem. |
| ga4_get_data_redactionB | Shows the data redaction settings (email addresses, URL parameters) of the web data streams of a property (v1alpha). |
| ga4_get_metadataA | Lists the dimensions and metrics that ga4_run_report knows for this property, incl. custom ones (customEvent:…, customUser:…). Use before a report instead of guessing API names. Without a filter only the apiNames; with search (substring in apiName, uiName, description), category or customOnly, uiName, category and metric type are added. |
| ga4_check_compatibilityA | Checks whether the dimensions and metrics fit together in one ga4_run_report (not every combination is allowed). compatible=false → requested shows which field is the problem. listAddable=true additionally returns all fields that can still be added. |
| ga4_run_funnel_reportA | Funnel analysis (Data API v1alpha runFunnelReport): how many users reach step 1, 2, 3 … and where they drop off. Returns activeUsers, funnelStepCompletionRate, funnelStepAbandonments, funnelStepAbandonmentRate per step. A step = eventName (optionally urlContains on page_location) or a raw FunnelFilterExpression. Example: [{"name":"Landing page","eventName":"page_view","urlContains":"/heat-pump"},{"name":"Form","eventName":"form_start"},{"name":"Lead","eventName":"generate_lead"}]. |
| ga4_list_annotationsA | Lists the annotations of a property that GA4 shows in reports as markers: e.g. relaunch, GTM publish, campaign start. Newest first. |
| gtm_list_versionsA | Lists the container versions (newest first) with name, number of tags/triggers/variables and a live=true marker. Basis for a rollback: view an older version via gtm_export_container (containerVersionId), then gtm_publish_version. |
| gtm_container_snippetA | Returns the GTM install code of a container (head snippet and noscript part for the body), e.g. for onboarding or to check the installation on the website. |
| gtm_lookup_containerA | Finds the container with accountId and containerId for a public ID: GTM-XXXX (container ID) or a linked destination ID such as G-XXXX or AW-123456789. |
| ga4_create_key_eventB | Marks an event as a key event (formerly conversion), e.g. 'generate_lead'. |
| ga4_create_custom_dimensionC | Creates a custom dimension for an event/user/item parameter. |
| ga4_create_custom_metricB | Creates a custom metric (event scope) for a numeric event parameter. |
| ga4_admin_requestA | Arbitrary call to the GA4 Admin API (analyticsadmin.googleapis.com) for anything without its own tool — e.g. PATCH 'properties/123/dataRetentionSettings?updateMask=eventDataRetention', DELETE 'properties/123/keyEvents/456', POST 'properties/123/customDimensions/789:archive', POST 'properties/123/dataStreams/111/measurementProtocolSecrets'. Path relative to the API version. Without confirm=true, DELETE only shows the current state of the resource and deletes nothing. |
| ga4_create_annotationA | Creates an annotation that GA4 shows in reports as a marker: e.g. 'Relaunch', 'GTM: Consent Mode v2 live', 'Campaign start'. One day (date) or a range (date + endDate). The color ORANGE is reserved for Google. Delete/change: ga4_admin_request (v1alpha). |
| gtm_create_workspaceB | Creates a new workspace — always bundle changes in a separate workspace, not in the default workspace of the live site. |
| gtm_save_entityA | Without entityId: creates the entity (POST). With entityId: replaces it completely (PUT) — fetch it first via gtm_list_entities, change it and send it back in full; if entity.fingerprint is included, GTM aborts if it was changed in the meantime. Example GA4 event tag: {"name":"GA4 – generate_lead","type":"gaawe","parameter":[{"type":"template","key":"eventName","value":"generate_lead"},{"type":"template","key":"measurementIdOverride","value":"G-XXXX"}],"firingTriggerId":["12"]}. Pre-check: JavaScript in Custom HTML tags and Custom JS variables must be ES5 strict (no let/const/arrow, no function declaration in try/if/for), every {{Variable}} must exist in the workspace. |
| gtm_revert_entityC | Resets an entity in the workspace to the state of the live version. An entity newly created in the workspace is removed in the process. |
| ga4_update_data_redactionA | Changes the data redaction of a web data stream: email addresses and/or the named URL parameters are redacted before GA4 stores them. Takes effect immediately and only for new data. Only the specified fields are changed. |
| gtm_delete_entityA | Deletes an entity from the workspace (live only after version + publish). Two steps: without confirm only a preview (name, type and what still references it, e.g. tags on a trigger), with confirm=true it is deleted. |
| gtm_sync_workspaceA | Pulls changes published in the meantime (e.g. from another workspace or the GTM UI) into the workspace. Needed when gtm_workspace_status or gtm_create_version reports conflicts or an outdated state. Then resolve conflicts with gtm_resolve_conflict. |
| gtm_resolve_conflictA | Resolves a merge conflict after gtm_sync_workspace: keep='workspace' keeps your own change, keep='base' takes the newer published state. type and id as in gtm_workspace_status / gtm_sync_workspace (e.g. type 'tag', id '42'). |
| gtm_import_gallery_templateA | Imports a tag or variable template from the GTM community gallery into the workspace (e.g. consent banners like Cookiebot, usercentrics or vendor pixels). galleryOwner/galleryRepository = GitHub owner and repo of the template (shown on the gallery page at tagmanager.google.com/gallery). acknowledgePermissions=true confirms the template's permissions (loading scripts, setting cookies …); review them first. |
| gtm_enable_built_in_variablesC | Enables built-in variables in the workspace, e.g. ['clickUrl','clickText','formId','pageUrl']. |
| gtm_create_versionA | Creates a container version from the workspace (NOT live yet). Returns containerVersionId for gtm_publish_version; compilerError=true means: the workspace has errors, do not publish anything. |
| gtm_publish_versionA | Publishes a container version — goes live on the live website immediately. Two steps: without confirm only a preview (version, current live version, added/removed/changed tags, triggers, variables, rollback yes/no). confirm=true only after explicit approval by a human. Rollback = publish an older version from gtm_list_versions. |
| gtm_requestA | Arbitrary call to the Tag Manager API v2 (www.googleapis.com/tagmanager/v2) for anything without its own tool — e.g. GET 'accounts/1/containers/2/versions/5', POST 'accounts/1/containers/2/workspaces/3:sync', POST 'accounts/1/containers/2/workspaces/3/templates'. Path relative to /tagmanager/v2. Without confirm=true, DELETE only shows the current state of the resource and deletes nothing. Publishing only via gtm_publish_version. |
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 45 tools
Most tools have distinct resource+action pairs, but a cluster of read/backup tools overlaps heavily: gtm_export_container vs gtm_export_version vs gtm_export_workspace vs gtm_list_entities, plus gtm_list_versions and backup_list/backup_read, require careful reading to pick correctly. The descriptions do explicitly disambiguate these (e.g. 'live version overview' vs 'complete backup'), which keeps it workable, but an agent can easily select the wrong one on the first try.
Strong, predictable ga4_/gtm_ prefix scheme with verb_noun suffixes for the vast majority (gtm_create_version, ga4_list_properties, gtm_delete_entity). A handful of outliers break the pattern: backup_list and backup_read invert to noun_verb, and gtm_workspace_status, gtm_quick_preview, gtm_container_snippet, google_token_info lack a verb entirely.
45 tools is heavy, but the server genuinely spans two large products (GA4 + GTM) with reporting, admin, versioning, and backup concerns. Still, several niche tools (gtm_import_gallery_template, gtm_enable_built_in_variables, ga4_create_annotation) could plausibly be folded into the existing escape hatches, trimming the surface.
Near-complete lifecycle coverage: GTM gets accounts, containers, workspaces, entity CRUD, sync/conflict resolution, preview, version create/publish/rollback, and templates; GA4 gets core/realtime/funnel reporting, metadata, compatibility checks, admin objects, redaction, annotations, and change history. The gtm_request and ga4_admin_request escape hatches cover anything left out, so there are no real dead ends.