Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

ga4_update_custom_metric

Updates a GA4 custom metric by changing only the fields you specify, deriving the update mask automatically; requires writes enabled and confirmation.

Instructions

[GA4 WRITE] Update a custom metric (parameterName and scope are immutable). 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_custom_metric"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesFull resource name of the custom metric to target: "properties/{property}/customMetrics/{id}".
confirmYesMust be true to apply the change.
updateMaskNoComma-separated field paths to update. Omit to derive from the supplied fields.
descriptionNo
displayNameNo
measurementUnitNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.497.5
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / name / description
      Previous value: -"Full resource name of the custom metric to target, e.g. \"properties/123/…/456\"."New value: +"Full resource name of the custom metric to target: \"properties/{property}/customMetrics/{id}\"."
    • removedInput schema / properties / name / minLength
      Removed value: -1
    • addedInput schema / properties / name / pattern
      Added value: +"^\\s*properties\\/\\d+\\/customMetrics\\/[A-Za-z0-9_-]+\\s*$"
  2. Addedv1.160.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does well: it discloses that this is a write operation gated behind an env flag and confirm=true, and that parameterName/scope are immutable so those edits will fail. It does not say what error surfaces when an immutable field is changed, or what the response contains, which keeps it from 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.

Conciseness4/5

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

Three compact sentences with the operation tag front-loaded and the prerequisites last; every clause carries information. The parenthetical stacking ('(override with an explicit updateMask for nested paths)') is dense but not wasteful.

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 zero annotations and no output schema, the description covers gating requirements, patch semantics, immutability constraints, and mask behavior. Return shape and failure behavior for immutable-field edits remain unstated, a modest gap for a write operation.

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 50% (description, displayName, and measurementUnit have no schema descriptions), so the description must compensate. It adds real meaning for the least obvious parameter by explaining updateMask derivation and the nested-path override, and flags what cannot be changed, but says nothing about the three unnamed editable fields or valid measurementUnit values.

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

Purpose4/5

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

The description names a specific verb and resource ('Update a custom metric') and tags it '[GA4 WRITE]', which separates it from read operations and from create/archive siblings. It does not explicitly route away from near-neighbors like ga4_update_custom_dimension or ga4_update_calculated_metric, but the resource noun plus the 'parameterName and scope are immutable' note makes the target unambiguous.

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 actionable usage rules: pass only changed fields, updateMask is auto-derived, and an explicit updateMask is only needed for nested paths. It also states prerequisites (GA4_MCP_ENABLE_WRITES=true and confirm=true). It stops short of naming when to use this versus create/archive siblings, so no exclusions are offered.

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