Skip to main content
Glama
mcp-google-analytics

mcp-google-analytics

Get gtag snippet

ga_get_tracking_snippet
Read-only

Returns the gtag.js tracking snippet for a Google Analytics measurement ID, ready to paste right after the tag to start collecting data.

Instructions

Returns the gtag.js snippet for a measurement ID, to paste right after .

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": {
      "measurementId": "<measurementId>"
    },
    "name": "ga_get_tracking_snippet"
  }
}

Input Schema

NameRequiredDescriptionDefault
measurementIdYesG-XXXXXXXXXX

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

readOnlyHint=true already declares the safe read profile, so the description only needs to add context; it adds that the return value is a paste-ready snippet. It does not say what happens with a malformed or nonexistent measurement ID, or whether the snippet includes extra config options.

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?

One compact sentence, front-loaded with the returned artifact and followed by the practical placement hint. No filler, though it is short enough that a clause on error behavior could be added at little cost.

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 one-parameter, read-only tool with no output schema, the description covers what comes back and how to use it. Minor gaps around invalid-ID handling are acceptable at this complexity.

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 100% and the single parameter already documents the G-XXXXXXXXXX format, so the description adds little beyond restating it as a "measurement ID." Baseline 3 applies when the schema carries the semantics.

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 ("Returns the gtag.js snippet") plus the key input (measurement ID) and the intended placement ("right after <head>"). It is clearly distinguishable from a mutation sibling like site_inject_tracking, though it never names an alternative explicitly.

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?

The phrase "to paste right after <head>" implies what to do with the result, but gives no explicit when-to-use versus when-not guidance and does not point to site_inject_tracking or site_verify_tracking for the automated/validation paths.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.