Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

ga4_update_data_stream

Updates a GA4 web data stream's display name and default URI via the Admin API. Use it to rename streams or change site URLs; tag settings like cross-domain tracking cannot be edited here.

Instructions

[GA4 WRITE] Update a data stream: displayName and (web) defaultUri ONLY. Cross-domain domains, unwanted referrals, internal traffic and session settings are Google tag settings with NO Admin API fields - never attempt them; direct the user to GA4 Admin > Data streams > Configure tag settings. Pass only the fields to change; updateMask is derived from them (override with an explicit updateMask for nested paths). 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": {
      "name": "<name>",
      "confirm": "<confirm>"
    },
    "name": "ga4_update_data_stream"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyNoRaw request-body object (JSON) merged OVER the typed fields — use for nested/advanced fields not exposed as flat args.
nameYesFull resource name of the data stream to target: "properties/{property}/dataStreams/{id}".
confirmYesMust be true to apply the change.
defaultUriNoNew site URL for a WEB stream (webStreamData.defaultUri).
updateMaskNoComma-separated field paths to update. Omit to derive from the supplied fields.
displayNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.497.5
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / body / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / name / description
      Previous value: -"Full resource name of the data stream to target, e.g. \"properties/123/…/456\"."New value: +"Full resource name of the data stream to target: \"properties/{property}/dataStreams/{id}\"."
    • removedInput schema / properties / name / minLength
      Removed value: -1
    • addedInput schema / properties / name / pattern
      Added value: +"^\\s*properties\\/\\d+\\/dataStreams\\/[A-Za-z0-9_-]+\\s*$"
  2. Addedv1.421.0
  3. Removedv1.350.0
  4. Addedv1.160.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it flags this as a WRITE, discloses the required environment flag and confirm=true gate, and explains that updateMask is derived from supplied fields unless overridden for nested paths. It stops short of stating reversibility or error/failure behavior, which keeps it below a 5.

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?

Front-loaded with a bracketed WRITE tag and the core scope sentence, then the exclusion warning, then mechanics, then prerequisites. Every sentence carries operational information (what to do, what never to do, where to send the user) with no filler.

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 mutation tool with no annotations and no output schema, the description covers scope, prerequisites, mask derivation, and the main failure mode (attempting unsupported tag settings). What it omits is what a successful response contains and how errors surface, a minor gap at this complexity level.

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 83%, so the schema already documents name, confirm, defaultUri, and updateMask including the derive-from-fields behavior. The description adds the constraint that only displayName and defaultUri are valid top-level targets, which is useful, but the raw 'body' escape hatch is never mentioned and no format details are added beyond the schema.

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 (update a data stream) and narrows scope to exactly two writable fields, displayName and (web) defaultUri. The explicit exclusion list (cross-domain domains, unwanted referrals, internal traffic, session settings) makes clear this is not the tool for other Configure-tag-settings work, distinguishing it from sibling update tools without needing their schemas.

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

Usage Guidelines5/5

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

Gives explicit when-not guidance: the listed tag settings have 'NO Admin API fields - never attempt them', with the concrete redirect to GA4 Admin > Data streams > Configure tag settings. It also states the operational prerequisites (GA4_MCP_ENABLE_WRITES=true and confirm=true) and tells the caller to pass only changed fields.

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