Skip to main content
Glama

Google Ads & Meta Ads

Google Analytics: Create Event Rule

ga4_create_event_rule
Idempotent

Create a GA4 event create rule on one web stream of the user's connected Google Analytics property: GA4 then derives a new event (e.g. generate_lead) from incoming events matching the conditions (e.g. page_view on a /thank-you URL), optionally copying their parameters and setting others. It applies to events received from now on. An identical rule is not created twice. It does not mark the event as a key event (ga4_mark_key_event) or change the website. dry_run previews. Changes configuration only after the user approved it.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "property_id": "<property_id>",
      "stream_id": "<stream_id>",
      "destination_event": "<destination_event>",
      "event_conditions": "<event_conditions>"
    },
    "name": "ga4_create_event_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
dry_runNotrue: read the current configuration and report the field-level changes this call would make, changing nothing. Default false. Show the user the proposal and get their approval before calling without dry_run.
stream_idYesThe data stream the rule runs on (a web stream): its number or properties/<p>/dataStreams/<number>, as ga4_get_tracking_configuration lists it.
property_idYesThe GA4 property: its number (123456789) or properties/123456789. Must be one of the properties ga4_get_account_summaries lists for the connected login.
event_conditionsYesConditions an incoming event must meet. All must match (AND), 1–10. Include one on eventName, e.g. [{"field":"eventName","comparison_type":"EQUALS","value":"page_view"},{"field":"page_location","comparison_type":"CONTAINS","value":"/thank-you"}].
destination_eventYesThe event to create, e.g. generate_lead.
parameter_mutationsNoParameters to set on the new event. At most 20. parameter_value may copy another parameter with [[name]]; "" removes the parameter.
source_copy_parametersNotrue copies the matching event's parameters to the new event. Default false.

Output Schema

NameRequiredDescriptionDefault
afterNoThe resource after the call (Google's read-back), or the proposal on a dry run.
beforeNoThe resource before the call; null when it did not exist.
dryRunYesTrue when the call only previewed the change.
changedYesTrue only when this call changed Google Analytics.
changesYesField-level changes: made, or proposed on a dry run.
propertyYesproperties/<number>.
resourceNoResource name the change targets, when it exists.
verifiedNoWhether Google's read-back holds every requested value; null when nothing was written.
operationYesWhat happened: the change made, no_change, or dry_run.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, destructiveHint=false and idempotentHint=true, and the description usefully concretizes the last one ('an identical rule is not created twice'). It also discloses real behavioral boundaries beyond annotations: forward-only effect on incoming events, no key-event marking, no website change, and an approval gate before configuration changes. However, the approval/preview workflow is largely restated from the dry_run schema field, and nothing is said about permissions or failure modes, so it is solid rather than exceptional.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded in the first clause and each following sentence adds distinct information (temporal scope, idempotency, non-effects, approval). The final sentence, 'Changes configuration only after the user approved it', is slightly redundant with the dry_run schema guidance and the approval instruction, but overall there is little waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a fully described 7-parameter schema, an output schema, and rich annotations, the description covers what an agent still needs: scope, forward-only effect, idempotency, non-effects, and the approval/preview workflow. Nothing material is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by supplying a concrete worked example ('page_view on a /thank-you URL') that clarifies how destination_event and event_conditions compose, and by stating that parameters may be copied or set on the derived event. It still leaves the comparison_type enum and the [[name]] copy syntax to the schema rather than adding interpretation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource ('Create a GA4 event create rule on one web stream') plus the derivation semantics: a new event is derived from incoming events matching conditions. It also names the scope (one web stream, from now on) so an agent can distinguish it from edit-rule siblings without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear context and one explicit exclusion by naming ga4_mark_key_event as the tool for key-event marking and stating it does not change the website. The 'applies to events received from now on' clause implicitly separates it from retroactive edit rules, but the description never names ga4_create_event_edit_rule as the alternative for retroactive edits, so the routing guidance is not fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources