google-measurement-mcp
v0.1.0MCP server for the Google measurement stack — GA4, Search Console, and Tag Manager in one server.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
ga4_run_report
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/#/a<account>p<property>/...), or under GA4 Admin -> Property details -> PROPERTY ID. Returns at most 25 rows unless `limit` is raised; prefer narrowing the date range or dimensions over raising it. Read-only.
| Parameter | Type | Description |
|---|---|---|
endDate * | string | End of the range, inclusive. Same formats as startDate. |
metrics * | array | GA4 metric API names, e.g. ['activeUsers','sessions','conversions']. At least one is required. |
propertyId * | string | GA4 numeric property ID, with or without the 'properties/' prefix. Call ga4_list_account_summaries to discover it. This is NOT the G-XXXXXXX measurement ID. |
startDate * | string | Start of the range. Accepts YYYY-MM-DD, 'today', 'yesterday', or 'NdaysAgo' (e.g. '28daysAgo'). |
dimensions | array | GA4 dimension API names, e.g. ['date','sessionSource','country']. Omit for totals only. |
keepEmptyRows | boolean | When true, returns rows whose metrics are all zero. Defaults to false. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
offset | integer | Zero-based row offset, for paging through a large report. |
ga4_run_realtime_report
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.
| Parameter | Type | Description |
|---|---|---|
metrics * | array | Realtime metric API names, e.g. ['activeUsers','screenPageViews']. |
propertyId * | string | Numeric GA4 property ID, with or without the 'properties/' prefix. Not the G-XXXXXXX measurement ID. |
dimensions | array | Realtime dimension API names, e.g. ['country','unifiedScreenName','deviceCategory']. Note the realtime schema is a SUBSET of the standard reporting schema — 'date' and most session-scoped dimensions… |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
ga4_list_account_summaries
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.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
ga4_list_custom_dimensions
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.
| Parameter | Type | Description |
|---|---|---|
propertyId * | string | Numeric GA4 property ID, with or without the 'properties/' prefix. Call ga4_list_account_summaries to discover it. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
ga4_list_key_events
Lists key events (formerly 'conversions') on a GA4 property, with counting method and whether each is deletable. Read-only.
| Parameter | Type | Description |
|---|---|---|
propertyId * | string | Numeric GA4 property ID, with or without the 'properties/' prefix. Call ga4_list_account_summaries to discover it. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
gsc_list_sites
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.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
gsc_search_analytics_query
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 `limit` deliberately or narrow with filters. Page with `startRow`. Read-only…
| Parameter | Type | Description |
|---|---|---|
endDate * | string | YYYY-MM-DD, inclusive. |
siteUrl * | string | Exact property string from Search Console: 'https://example.com/' (URL-prefix) or 'sc-domain:example.com' (Domain). Call gsc_list_sites for valid values. |
startDate * | string | YYYY-MM-DD. Relative dates are NOT supported. |
aggregationType | string | Defaults to 'auto'. Cannot be 'byProperty' when grouping or filtering by page. |
dataState | string | 'final' (default) excludes incomplete data. 'all' includes fresh partial data. 'hourly_all' enables the 'hour' dimension. |
dimensionFilterGroups | array | Filter groups: [{ groupType: 'and', filters: [{ dimension, operator, expression }] }]. Operators: contains, equals, notContains, notEquals, includingRegex, excludingRegex (RE2 syntax). You may filter… |
dimensions | array | Group by these. 'hour' requires dataState='hourly_all'. Results are keyed in the order supplied. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
startRow | integer | Zero-based offset for paging. Search Console uses an offset, not a page token. |
type | string | Search surface. Defaults to 'web'. Replaces the deprecated `searchType`. |
gsc_list_sitemaps
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.
| Parameter | Type | Description |
|---|---|---|
siteUrl * | string | Exact property string from Search Console. Call gsc_list_sites for valid values. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
gsc_inspect_url
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.
| Parameter | Type | Description |
|---|---|---|
inspectionUrl * | string | Fully-qualified URL to inspect. Must belong to the siteUrl property. |
siteUrl * | string | The Search Console property that owns the URL being inspected. |
languageCode | string | BCP-47 code for localized result text, e.g. 'en-US'. Optional. |
gtm_list_accounts
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.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
gtm_list_containers
Lists containers in a Tag Manager account. Call gtm_list_accounts first to get the accountId. NOTE the response has two different IDs: `containerId` is the numeric internal ID that every other GTM tool needs, while `publicId` is the GTM-XXXXXXX string shown in the UI. Pass the numeric one. Read-only.
| Parameter | Type | Description |
|---|---|---|
accountId * | string | GTM account ID, with or without the 'accounts/' prefix. Call gtm_list_accounts to discover it. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
gtm_list_workspaces
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 `path` or accountId + containerId (numeric internal ID). Read-only.
| Parameter | Type | Description |
|---|---|---|
accountId | string | GTM account ID. Ignored if `path` is supplied. |
containerId | string | GTM container ID — the NUMERIC internal ID from gtm_list_containers, not the GTM-XXXXXXX public ID. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
path | string | Full container path 'accounts/{a}/containers/{c}'. Alternative to supplying accountId and containerId separately. |
gtm_list_tags
Lists tags in a Tag Manager workspace with their type, firing triggers and parameters. Accepts a full workspace `path` or accountId + containerId + workspaceId. Parameters are condensed to key/value pairs for readability. Read-only.
| Parameter | Type | Description |
|---|---|---|
accountId | string | GTM account ID. Ignored if `path` is supplied. |
containerId | string | Numeric internal container ID, not GTM-XXXXXXX. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
path | string | Full workspace path 'accounts/{a}/containers/{c}/workspaces/{w}'. Alternative to the three IDs. |
workspaceId | string | Workspace ID from gtm_list_workspaces. |
gtm_list_triggers
Lists triggers in a Tag Manager workspace with their type and firing conditions. Accepts a full workspace `path` or accountId + containerId + workspaceId. Read-only.
| Parameter | Type | Description |
|---|---|---|
accountId | string | GTM account ID. Ignored if `path` is supplied. |
containerId | string | Numeric internal container ID, not GTM-XXXXXXX. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
path | string | Full workspace path 'accounts/{a}/containers/{c}/workspaces/{w}'. Alternative to the three IDs. |
workspaceId | string | Workspace ID from gtm_list_workspaces. |
gtm_list_variables
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 `path` or accountId + containerId + workspaceId. Read-only.
| Parameter | Type | Description |
|---|---|---|
accountId | string | GTM account ID. Ignored if `path` is supplied. |
containerId | string | Numeric internal container ID, not GTM-XXXXXXX. |
limit | integer | Maximum rows to return. Defaults to 25 to protect the context window. Prefer narrowing the query over raising this. |
pageToken | string | Opaque token from a previous response's `nextPageToken`, to fetch the following page. Paging is manual so the caller controls cost. |
path | string | Full workspace path 'accounts/{a}/containers/{c}/workspaces/{w}'. Alternative to the three IDs. |
workspaceId | string | Workspace ID from gtm_list_workspaces. |