Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

ga4_create_measurement_protocol_secret

Create a Measurement Protocol secret for a GA4 data stream to authenticate event uploads; requires GA4 write access enabled and confirm=true.

Instructions

[GA4 WRITE] Create a Measurement Protocol secret on a data stream. The response includes the secretValue — store it securely. 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>",
      "dataStreamId": "<dataStreamId>",
      "displayName": "<displayName>",
      "confirm": "<confirm>"
    },
    "name": "ga4_create_measurement_protocol_secret"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmYesMust be true to apply the change.
propertyYesGA4 property ID, e.g. "123456789" or "properties/123456789".
displayNameYesHuman-readable name for the secret.
dataStreamIdYesData stream ID (numeric) or "dataStreams/{id}".

Schema Changelog

Changes observed during successful MCP inspections.

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

TDQS

A3.8/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 a fair job: it discloses that the response contains a secretValue that must be stored securely (a non-obvious, effectively one-time disclosure), and it names the two gating prerequisites (env flag and confirm=true). It does not cover permission requirements, idempotency, or whether an existing secret is rotated or duplicated.

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?

Three short sentences, front-loaded with purpose, then the critical return-value caveat, then prerequisites. Every sentence carries information an agent needs; no filler or restatement of the 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 write tool with no output schema and no annotations, the description covers the operation, the surprising return payload, and the preconditions. Only failure modes (writes disabled, invalid data stream) and permission scope remain unstated, which are minor for a single-purpose create call.

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%, with all four parameters documented in the schema including ID formats and the confirm requirement. The description adds nothing parameter-specific beyond echoing that confirm must be true, so the baseline of 3 applies.

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?

States a specific verb and resource: 'Create a Measurement Protocol secret on a data stream', which is clearly distinct from the delete/update measurement-protocol-secret siblings and from other ga4_create_* tools. The '[GA4 WRITE]' prefix further signals the operation class. It stops short of naming any sibling explicitly, so differentiation relies on the verb+resource phrase rather than routing language.

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?

No explicit when-to-use vs. alternatives guidance, but the '[GA4 WRITE]' tag plus 'Requires GA4_MCP_ENABLE_WRITES=true and confirm=true' effectively signals the context in which this tool applies and what must be true before calling it. There is no statement about when not to use it or what to do if a secret already exists.

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