Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

ga4_update_data_retention

Updates a GA4 property's event data retention period (2 to 50 months) and whether user data resets on new activity. Use it to control how long analytics data is stored.

Instructions

[GA4 WRITE] Update a property's event data retention (2/14/26/38/50 months; the longer options are 360-only) and whether it resets on new activity. Requires GA4_MCP_ENABLE_WRITES=true and confirm=true.

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": "<property>",
      "confirm": "<confirm>"
    },
    "name": "ga4_update_data_retention"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmYes
propertyYesGA4 property ID, e.g. "123456789" or "properties/123456789".
eventDataRetentionNo
resetUserDataOnNewActivityNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.497.5
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / property / minLength
      Removed value: -1
    • addedInput schema / properties / property / pattern
      Added value: +"^\\s*(properties\\/)?\\d+\\s*$"
  2. Addedv1.160.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does substantial work: it flags this as a write, discloses the feature-toggle and confirm gate, and warns that the 38/50-month options are 360-only, a real behavioral constraint an agent would otherwise miss. It does not state that shortening retention is irreversible or that existing event data may be dropped, which is the one gap left for a destructive mutation.

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?

A single dense sentence preceded by a leading [GA4 WRITE] tag — the mutation risk is front-loaded, then resource, value domain, and prerequisites in priority order. No filler or restatement of the tool name.

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

Completeness4/5

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

For a four-parameter mutation with no annotations and no output schema, the definition covers the write gate, the value domain, the plan limitation, and the reset semantics. Only the consequences of the change (data loss on shortened retention, response shape) are unstated, which is a modest gap rather than a blocking one.

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 coverage is only 25%, with just `property` documented, so the description must compensate: it maps the month values (2/14/26/38/50) to the retention enum and explains the reset-on-new-activity boolean and the confirm flag. It adds genuine meaning over the bare schema, but the exact enum string mapping and any constraint on resetUserDataOnNewActivity relative to plan tier are left implicit.

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?

The description pairs a specific verb (Update) with a precise resource (a property's event data retention) and enumerates the two mutable fields: retention length and whether it resets on new activity. The [GA4 WRITE] tag and the resource specificity make it immediately distinguishable from the read-side sibling ga4_data_retention_get.

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?

It gives clear preconditions for invocation — GA4_MCP_ENABLE_WRITES=true and confirm=true — which tells an agent when this call is even legal to make. It does not explicitly name the read tool (ga4_data_retention_get) as the non-mutating alternative or state when not to use it, so it stops short of full when/when-not guidance.

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

Deploy Server

Other Tools