Skip to main content
Glama

Google Ads & Meta Ads

Google Analytics: Create Event Edit Rule

ga4_create_event_edit_rule
DestructiveIdempotent

Create a GA4 event edit (modify event) rule on one web stream of the user's connected Google Analytics property: incoming events matching the conditions get parameters set, copied, removed or renamed (event_name) before processing. Runs after the stream's existing edit rules (reorder with ga4_reorder_event_edit_rules) and applies to events received from now on. An identical rule is not created twice. 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>",
      "display_name": "<display_name>",
      "event_conditions": "<event_conditions>",
      "parameter_mutations": "<parameter_mutations>"
    },
    "name": "ga4_create_event_edit_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.
display_nameYesRule name shown in GA4, at most 255 characters.
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"}].
parameter_mutationsYesChanges to make to matching events, at least one. At most 20. parameter_value may copy another parameter with [[name]]; "" removes the parameter.

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.3/5.0
Behavior4/5

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

Beyond the annotations (destructiveHint=true, idempotentHint=true), the description discloses execution ordering, non-retroactivity ('applies to events received from now on'), duplicate suppression, and a dry_run/approval workflow. That is meaningful added behavior for a mutating config tool, though it doesn't say what is lost on deletion/update of such rules or what permissions are needed.

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

Conciseness5/5

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

Five compact clauses, front-loaded with the action and scope, then ordering, temporal scope, idempotency, and the dry_run/approval rule. No filler and every sentence carries a distinct fact an agent needs.

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?

An output schema exists, so return values need not be explained. For a destructive, 6-parameter configuration mutation, the description covers ordering, temporal effect, duplicate handling, and the dry_run approval gate — everything an agent needs to invoke it safely.

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

Parameters3/5

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

Schema description coverage is 100% and the schema already documents property_id, stream_id, dry_run, event_conditions (AND semantics, 1–10) and parameter_mutations ([[name]] copying, empty string removal). The description mostly restates the mutation vocabulary and adds no new format or constraint detail, so the baseline 3 applies.

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 specific verb and resource ('Create a GA4 event edit (modify event) rule') plus the exact scope ('on one web stream of the user's connected Google Analytics property'). The parenthetical and the mechanical explanation (set, copy, remove, rename parameters, including event_name) make clear this is a configuration rule, not event-sending or event-creation, so an agent can tell it apart from ga4_create_event_rule and ga4_update_event_edit_rule.

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 operational context: rules run after existing edit rules (pointing to ga4_reorder_event_edit_rules for ordering), apply only to events received from now on, are not duplicated, and dry_run previews changes with user approval required before a real call. Lacks an explicit statement of when NOT to use it versus the sibling create/update tools, which keeps it from a 5.

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