google-measurement-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GMCP_ENABLE_WRITE | No | Set to '1' to enable write tools. Equivalent to the --enable-write command-line flag. | |
| GMCP_TOKEN_PROFILE | No | Named profile for holding several Google identities on one machine. | default |
| GMCP_OAUTH_CLIENT_ID | No | OAuth desktop client ID. Used for OAuth authentication. If provided, GMCP_OAUTH_CLIENT_SECRET is also required. | |
| GMCP_DEFAULT_ROW_LIMIT | No | Default row cap on every report tool. | 25 |
| GMCP_OAUTH_CLIENT_JSON | No | Path to a downloaded OAuth client JSON file, as an alternative to providing GMCP_OAUTH_CLIENT_ID and GMCP_OAUTH_CLIENT_SECRET. | |
| GMCP_OAUTH_CLIENT_SECRET | No | OAuth desktop client secret. Used with GMCP_OAUTH_CLIENT_ID for OAuth authentication. | |
| GOOGLE_APPLICATION_CREDENTIALS | No | Path to a service account JSON key file. When set, the server uses service account authentication. |
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 | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ga4_get_metadataA | Discover valid GA4 field names, descriptions and custom definitions for a property before reporting. Does not guarantee every combination is compatible. |
| ga4_run_reportA | Runs a Google Analytics 4 report and returns rows as flat objects. Requires the NUMERIC GA4 propertyId (e.g. 123456789), not the G-XXXXXXX measurement ID. If the user does not know it, it appears in any GA4 URL as the digits after 'p' (analytics.google.com/analytics/web/#/ap/...), or under GA4 Admin -> Property details -> PROPERTY ID. Returns at most 25 rows unless |
| ga4_run_realtime_reportA | Returns activity from roughly the last 30 minutes. Requires the NUMERIC GA4 propertyId (call ga4_list_account_summaries to find it). IMPORTANT: the realtime schema is a SUBSET of the standard reporting schema — 'date', 'sessionSource' and most session-scoped fields are unavailable and will error. Common realtime dimensions: country, city, deviceCategory, unifiedScreenName, eventName. Common realtime metrics: activeUsers, screenPageViews, eventCount. For anything older than 30 minutes use ga4_run_report instead. Read-only. |
| ga4_list_account_summariesA | Lists every Google Analytics account the authenticated user can see, with the properties under each. Use this FIRST to discover the numeric propertyId that other GA4 tools require. Returns account name, display name, and for each property its ID and display name. Read-only. |
| ga4_list_custom_dimensionsA | Lists custom dimensions configured on a GA4 property, with parameter name, display name, and scope (EVENT/USER/ITEM). Useful for discovering which custom dimensions exist before referencing them in ga4_run_report. Read-only. |
| ga4_list_key_eventsA | Lists key events (formerly 'conversions') on a GA4 property, with counting method and whether each is deletable. Read-only. |
| gsc_list_sitesA | Lists every Search Console property the authenticated user can access, with their permission level. Use this FIRST to get the exact siteUrl string other Search Console tools need — the format is significant ('https://example.com/' for URL-prefix properties, 'sc-domain:example.com' for Domain properties). Read-only. |
| gsc_search_analytics_queryA | Returns clicks, impressions, CTR and average position from Search Console, grouped by the dimensions you choose. This is the primary SEO analysis tool. siteUrl must be the exact string from gsc_list_sites. Dates are YYYY-MM-DD only — relative forms like '28daysAgo' are NOT supported here (unlike the GA4 tools). Data lags roughly 2-3 days; use dataState='all' to include fresh partial data. Returns at most 25 rows by default while the API itself allows up to 25,000, so do not assume you are seeing everything — raise |
| gsc_list_sitemapsA | Lists sitemaps submitted for a Search Console property, with last-downloaded time, warning and error counts, and per-type indexed counts. Useful for diagnosing indexing problems. Read-only. |
| gsc_inspect_urlA | Returns Google's index status for a single URL: coverage verdict, last crawl time, Google-selected vs user-declared canonical, mobile usability, and rich-results verdict. QUOTA: 2,000 queries per day and 600 per minute PER PROPERTY. Do not loop this over a list of URLs without checking the quota budget first — inspect specific URLs the user asked about, and prefer gsc_search_analytics_query for anything aggregate. Read-only. |
| gtm_list_accountsA | Lists every Google Tag Manager account the authenticated user can access. Use this FIRST to discover accountId, then gtm_list_containers, then gtm_list_workspaces. Read-only. |
| gtm_list_containersA | Lists containers in a Tag Manager account. Call gtm_list_accounts first to get the accountId. NOTE the response has two different IDs: |
| gtm_list_workspacesA | Lists workspaces in a container. Workspaces are the safe editing surface — all writes in this server operate on a workspace, never the live container. Accepts either a full container |
| gtm_list_tagsA | Lists tags in a Tag Manager workspace with their type, firing triggers and parameters. Accepts a full workspace |
| gtm_list_triggersA | Lists triggers in a Tag Manager workspace with their type and firing conditions. Accepts a full workspace |
| gtm_list_variablesA | Lists user-defined variables in a Tag Manager workspace with their type and parameters. Note this returns user-defined variables only — built-in variables are a separate collection. Accepts a full workspace |
| gtm_get_live_versionA | Read the full currently published GTM version. Configuration is not proof a tag fired in a browser. May return a large container; choose a specific container. |
| gtm_preview_versionA | READ ONLY. Compare a candidate version to the live version by stable entity IDs and configuration, including modified fields. This server cannot publish. Review full changes in Google Tag Manager before publishing there. |
| gsc_compare_periodsA | Compare web-search totals for two equal-length, non-overlapping date ranges using final data. Returns click/impression changes and CTR percentage-point change; zero baselines yield null percentage change. Uses two read requests. |
| gmcp_diagnosticsA | Check credential availability and read/write mode without exposing tokens or client secrets. Does not guarantee access to any particular property. Never starts browser sign-in. |
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 20 tools
Every tool is namespaced by Google product (ga4_, gsc_, gtm_) and targets a distinct resource or action; the only close pair, gsc_search_analytics_query and gsc_compare_periods, is clearly differentiated by purpose and output. The gtm_list_* family covers separate collections (accounts, containers, workspaces, tags, triggers, variables), so an agent should not confuse them.
The set is uniformly snake_case and strongly patterned: ga4_/gsc_/gtm_ prefixes with list_ for collection reads and get_/run_/inspect_/compare_ for actions. Minor deviations such as gsc_search_analytics_query (noun-style) and gmcp_diagnostics (no action verb) keep it from a perfect score.
Twenty tools is at the high end, but the number is reasonable for a server spanning three distinct Google products (GA4, Search Console, Tag Manager) plus diagnostics. Each cluster has enough tools to support real read-only workflows without feeling padded.
The read-only measurement surface is largely covered: GA4 has metadata/reporting/realtime/discovery, Search Console has search analytics/sitemaps/URL inspection, and GTM has account-through-entity listing plus live/version comparison. Minor gaps remain, such as no GTM built-in variable tool or GTM write/publish operations, but these appear to be intentionally out of scope.