Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

ga4_create_custom_metric

Creates a GA4 custom metric from an event parameter, letting you register event-level metrics after enabling writes and confirming the change.

Instructions

[GA4 WRITE] Create a custom metric. 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>",
      "parameterName": "<parameterName>",
      "displayName": "<displayName>",
      "measurementUnit": "<measurementUnit>",
      "scope": "<scope>",
      "confirm": "<confirm>"
    },
    "name": "ga4_create_custom_metric"
  }
}

Input Schema

NameRequiredDescriptionDefault
scopeYesCustom metric scope (EVENT).
confirmYesMust be true to apply the change.
propertyYesGA4 property ID, e.g. "123456789" or "properties/123456789".
descriptionNo
displayNameYes
parameterNameYesEvent parameter name to register as a metric.
measurementUnitYesMeasurement unit.
restrictedMetricTypeNoRestricted-metric types (for CURRENCY metrics).

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.421.0
  3. Removedv1.350.0
  4. Addedv1.160.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does creditably disclose the two-stage write gate (environment flag and explicit confirm), which is genuinely useful behavioral context, but it says nothing about irreversibility, quota/metric-count limits, or propagation delay before the metric becomes usable in reports.

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?

Two short sentences, with the write classification and gating conditions front-loaded and no filler. It is arguably too terse for an eight-parameter mutation, but nothing is wasted.

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

Completeness3/5

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

For a write tool with eight parameters, no annotations, and no output schema, the definition covers the safety gate but omits return behavior and constraints an agent needs to call it safely. Adequate but with clear gaps.

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 a fairly high 75%, so the schema itself explains property ID format, measurementUnit enum, scope, and parameterName. The description only echoes the confirm flag and adds no meaning about the undocumented description field or how restrictedMetricType interacts with CURRENCY units.

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 states a specific verb and resource ("Create a custom metric") and the [GA4 WRITE] tag flags the mutation class. It does not, however, distinguish this from near siblings such as ga4_create_calculated_metric or ga4_create_custom_dimension, so an agent must infer the difference from the names alone.

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

Usage Guidelines3/5

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

It gives an operational prerequisite rather than a usage rule: GA4_MCP_ENABLE_WRITES=true plus confirm=true. That tells the agent how the call can succeed, but nothing about when to choose a custom metric versus a calculated metric or a custom dimension, and no exclusions are stated.

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