Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

environments_reauthorize

Regenerate a GTM environment's authorization code, rotating its auth token. Update any embedded snippet using the old token to restore access.

Instructions

[PUBLISH] Re-generate the authorization code for a GTM environment. Requires GTM_MCP_ENABLE_PUBLISH=true and confirm=true. ⚠️ This rotates the environment auth token; any embedded snippet using the old token stops working until updated.

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": {
      "accountId": "<accountId>",
      "containerId": "<containerId>",
      "environmentId": "<environmentId>",
      "confirm": "<confirm>"
    },
    "name": "environments_reauthorize"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmYesMust be true to confirm this high-impact operation.
accountIdYesThe GTM account ID.
containerIdYesThe GTM container ID.
environmentIdYesThe GTM environment ID to reauthorize.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.497.5
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / accountId / pattern
      Added value: +"^\\d+$"
    • addedInput schema / properties / containerId / pattern
      Added value: +"^\\d+$"
    • addedInput schema / properties / environmentId / pattern
      Added value: +"^\\d+$"
  2. Addedv1.421.0
  3. Removedv1.350.0
  4. First observedv1.0.0

TDQS

A4.2/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 behavioral burden, and it does so for the most important trait: it flags that this rotates the environment auth token and that embedded snippets using the old token break until updated. It does not say whether the old token can be recovered/rolled back 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.

Conciseness5/5

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

Three short sentences: identity first, preconditions second, destructive consequence flagged last with a warning glyph. Every sentence carries distinct information and nothing is redundant with the schema.

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 high-impact mutation with no annotations and no output schema, the definition covers prerequisites and the main side effect well. The one omission is the return value (i.e., that a new auth code is produced and how it is surfaced), which matters because no output schema exists.

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%, so all four parameters are already documented in the schema. The description reinforces confirm=true and ties environmentId to the token rotation, but adds no syntax or format detail beyond what the schema already states, so baseline 3 applies.

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 ('Re-generate') and resource ('authorization code for a GTM environment'), and the [PUBLISH] tag plus 'reauthorize' name distinguishes it from the environments_update/delete/get siblings. An agent can identify the operation without opening the schema.

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 concrete preconditions for invocation (GTM_MCP_ENABLE_PUBLISH=true and confirm=true) and implicitly scopes usage through the [PUBLISH] marker. It stops short of naming an alternative or an explicit when-not-to-use condition, but the operation is narrow enough that this is a minor gap.

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