Skip to content

MCP

Google Analytics 4 MCPTool documentation

11 tool calls, their inputs and the limits of this connection. Implementation snapshot: 8 October 2026.

The complete tool reference.

8 read tools and 3 write tools. Open a tool to see its parameters and full JSON Schema. Unknown fields are rejected.

ga4_list_propertiesList selected properties
Read

List only properties selected for this grant. Connect and discover further properties in the Billing Portal.

Input parameters

No parameters. Pass an empty object: {}.

Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
ga4_get_propertyGet property
Read

Read the selected GA4 property configuration.

Input parameters

resource_keyRequired
string · Max. characters: 100
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    }
  },
  "required": [
    "resource_key"
  ],
  "additionalProperties": false
}
ga4_get_quota_snapshotGet quota snapshot
Read

Read current Core/Realtime quota budgets for this property. This uses one token from the category with most remaining quota.

Input parameters

resource_keyRequired
string · Max. characters: 100
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    }
  },
  "required": [
    "resource_key"
  ],
  "additionalProperties": false
}
ga4_get_metadataGet reporting metadata
Read

List available reporting dimensions and metrics for this selected GA4 property.

Cache: 60 seconds.

Input parameters

resource_keyRequired
string · Max. characters: 100
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    }
  },
  "required": [
    "resource_key"
  ],
  "additionalProperties": false
}
ga4_run_reportRun performance report
Read

Read a bounded GA4 report: up to 31 days, 5 dimensions, 10 metrics and 10000 rows. Provider quota is returned. No automatic pagination.

Cache: 60 seconds.

Input parameters

resource_keyRequired
string · Max. characters: 100
dimensionsOptional
array · Default: [] · Max. entries: 5 · Entries: string
metricsRequired
array · Min. entries: 1 · Max. entries: 10 · Entries: string
limitOptional
integer · Default: 1000 · min. 1 · max. 10000
start_dateRequired
string · date
end_dateRequired
string · date
offsetOptional
integer · Default: 0 · min. 0 · max. 50000
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    },
    "dimensions": {
      "default": [],
      "maxItems": 5,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 100,
        "pattern": "^[A-Za-z][A-Za-z0-9_:]*$"
      }
    },
    "metrics": {
      "minItems": 1,
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 100,
        "pattern": "^[A-Za-z][A-Za-z0-9_:]*$"
      }
    },
    "limit": {
      "default": 1000,
      "type": "integer",
      "minimum": 1,
      "maximum": 10000
    },
    "start_date": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    },
    "offset": {
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 50000
    }
  },
  "required": [
    "resource_key",
    "metrics",
    "start_date",
    "end_date"
  ],
  "additionalProperties": false
}
ga4_run_realtime_reportRun realtime report
Read

Read current GA4 activity for up to 10000 rows. Provider quota is returned; results are not cached.

Input parameters

resource_keyRequired
string · Max. characters: 100
dimensionsOptional
array · Default: [] · Max. entries: 5 · Entries: string
metricsRequired
array · Min. entries: 1 · Max. entries: 10 · Entries: string
limitOptional
integer · Default: 1000 · min. 1 · max. 10000
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    },
    "dimensions": {
      "default": [],
      "maxItems": 5,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 100,
        "pattern": "^[A-Za-z][A-Za-z0-9_:]*$"
      }
    },
    "metrics": {
      "minItems": 1,
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 100,
        "pattern": "^[A-Za-z][A-Za-z0-9_:]*$"
      }
    },
    "limit": {
      "default": 1000,
      "type": "integer",
      "minimum": 1,
      "maximum": 10000
    }
  },
  "required": [
    "resource_key",
    "metrics"
  ],
  "additionalProperties": false
}
ga4_list_key_eventsList key events
Read

Read one bounded page of key events configured for this property.

Input parameters

resource_keyRequired
string · Max. characters: 100
page_tokenOptional
string · Max. characters: 4096
page_sizeOptional
integer · Default: 100 · min. 1 · max. 200
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    },
    "page_token": {
      "type": "string",
      "maxLength": 4096
    },
    "page_size": {
      "default": 100,
      "type": "integer",
      "minimum": 1,
      "maximum": 200
    }
  },
  "required": [
    "resource_key"
  ],
  "additionalProperties": false
}
ga4_get_key_eventGet key event
Read

Read one selected property key event.

Input parameters

resource_keyRequired
string · Max. characters: 100
key_event_idRequired
string · Max. characters: 40
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    },
    "key_event_id": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^[1-9]\\d*$"
    }
  },
  "required": [
    "resource_key",
    "key_event_id"
  ],
  "additionalProperties": false
}
ga4_create_key_eventCreate key event
Write

Mark an event as a GA4 key event. Changes reporting configuration; requires explicit user intent. operation_id prevents blind repeated creation.

Input parameters

resource_keyRequired
string · Max. characters: 100
operation_idRequired
string · uuid
event_nameRequired
string · Max. characters: 40
counting_methodRequired
string · ONCE_PER_EVENT | ONCE_PER_SESSION
default_valueOptional
object · Required inside object: numericValue, currencyCode
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    },
    "operation_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      "description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
    },
    "event_name": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
    },
    "counting_method": {
      "type": "string",
      "enum": [
        "ONCE_PER_EVENT",
        "ONCE_PER_SESSION"
      ]
    },
    "default_value": {
      "type": "object",
      "properties": {
        "numericValue": {
          "type": "number"
        },
        "currencyCode": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        }
      },
      "required": [
        "numericValue",
        "currencyCode"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "resource_key",
    "operation_id",
    "event_name",
    "counting_method"
  ],
  "additionalProperties": false
}
ga4_update_key_eventUpdate key event
Write

Change counting method and/or default value of an existing key event. Event name is immutable. Requires explicit user intent.

Input parameters

resource_keyRequired
string · Max. characters: 100
operation_idRequired
string · uuid
key_event_idRequired
string · Max. characters: 40
counting_methodOptional
string · ONCE_PER_EVENT | ONCE_PER_SESSION
default_valueOptional
object · Required inside object: numericValue, currencyCode
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    },
    "operation_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      "description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
    },
    "key_event_id": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^[1-9]\\d*$"
    },
    "counting_method": {
      "type": "string",
      "enum": [
        "ONCE_PER_EVENT",
        "ONCE_PER_SESSION"
      ]
    },
    "default_value": {
      "type": "object",
      "properties": {
        "numericValue": {
          "type": "number"
        },
        "currencyCode": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        }
      },
      "required": [
        "numericValue",
        "currencyCode"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "resource_key",
    "operation_id",
    "key_event_id"
  ],
  "additionalProperties": false
}
ga4_delete_key_eventDelete key event
Write

Remove a deletable GA4 key-event configuration; does not delete historical event data. Requires explicit user intent.

Changes existing configuration or campaign status. Requires explicit user intent.

Input parameters

resource_keyRequired
string · Max. characters: 100
operation_idRequired
string · uuid
key_event_idRequired
string · Max. characters: 40
Full input schema (JSON)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_key": {
      "type": "string",
      "maxLength": 100,
      "pattern": "^properties\\/[1-9]\\d*$"
    },
    "operation_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      "description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
    },
    "key_event_id": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^[1-9]\\d*$"
    }
  },
  "required": [
    "resource_key",
    "operation_id",
    "key_event_id"
  ],
  "additionalProperties": false
}

A concrete tool call.

JSON-RPC request after MCP initialization. Sample IDs and dates: replace them with your selected resource and reporting period. The AI client handles transport and authorization.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ga4_run_report",
    "arguments": {
      "resource_key": "properties/123456789",
      "start_date": "2026-09-01",
      "end_date": "2026-09-07",
      "dimensions": [
        "sessionDefaultChannelGroup"
      ],
      "metrics": [
        "sessions",
        "keyEvents"
      ],
      "limit": 100
    }
  }
}

How results come back.

structuredContent
Contains the tool result as a JSON object. Google field names are retained. The same JSON is also returned as a text block in content.
Data by tool
Reports return dimensionHeaders, metricHeaders, rows, rowCount and propertyQuota. Metadata lists dimensions and metrics. Key-event calls return the relevant configuration; list calls may include nextPageToken.
Selected resources
The first list tool returns resources containing resource_key. It lists only resources authorized for this connection.
isError: true
Tool failures return structuredContent.error and request_id, optionally retry_after_seconds. For example: scope_missing for missing access or service_unavailable when a service cannot be reached. Do not repeat an uncertain write blindly.

Access and technical limits.

Reports: at most 31 inclusive days, 5 dimensions, 10 metrics and 10,000 rows. Use offset for further rows; no automatic pagination. Metadata and performance reports may be cached for 60 seconds; realtime reports are not. Metadata/report calls may require a fresh quota snapshot, which itself uses quota. Key events change reporting configuration, not historical event data.

Connection uses MCP Streamable HTTP with bearer authorization. The server checks read/write scope and the selected resource for each call. Both your Google permissions and MCP connection permissions must allow the operation. Clients discover tools using tools/list; these pages document the tool registry.

Read scope: mcp:ga4:read. Write scope: mcp:ga4:write.

Every write requires a UUID operation_id. Reuse it only for the exact same operation, never with changed arguments. A completed replay reports mutation_status: succeeded and replayed: true, optionally result_ref, rather than the original Google response. Writes are not retried automatically.