ai-google-analytics-mcp
The ai-google-analytics-mcp server lets you provision, configure, and integrate Google Analytics 4 (GA4) into local AI/web projects — from creating GA4 properties to injecting tracking code into HTML files.
Authentication & Setup
Get step-by-step GCP/GA4 authentication instructions (gcloud ADC or service account setup)
Check integration status of optional launcher registry and keymaster hooks
Account & Property Discovery
List all GA account summaries and their child properties (read-only Admin API)
Property & Stream Provisioning
Create a new GA4 property under a specified account (configurable timezone, currency, environment)
Create a web data stream for a GA4 property and retrieve its Measurement ID (
G-XXXXXXXX)
Tracking Code Generation & Injection
Render an HTML
gtagsnippet for a given Measurement IDInject or update a
gtagsnippet directly into local HTML or layout files (with dry-run preview support)Generate a Next.js
GoogleAnalytics.tsxclient component (envorinlinemode, optional cookie consent gating)Scaffold full GA4 integration for a Next.js app: write the component, wire it into
layout.tsx, and configure.env.local
Project Configuration
Save a
.ga4.config.jsonfile in a project root for future agent/human referenceRun an end-to-end provisioning workflow: create property + stream, optionally save config, inject gtag, and sync to registry — all in one call
Registry Integration
List projects from a launcher registry with hints about existing GA4 config and keymaster status
Resolve a registry slug or filesystem path to get website URL, web roots, and agent hints
Sync GA4 metadata (Measurement ID, property ID, etc.) back to a launcher registry project entry (requires writable env)
Provisions Google Analytics 4 properties and web data streams, creates measurement IDs, injects gtag snippets into HTML, and configures GA4 tracking for web projects.
Scaffolds Google Analytics 4 tracking components for Next.js applications, including component files and layout wiring.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ai-google-analytics-mcpSet up GA4 for my project at https://example.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ai-google-analytics-mcp
MCP server to provision Google Analytics 4 for local AI/web projects: create properties and web data streams, capture measurement IDs, inject gtag into HTML, and write .ga4.config.json in project roots.
For reporting and monitoring, use Google's official read-only analytics-mcp alongside this server (see CONTEXT.md).
Tools
Tool | Purpose |
| gcloud ADC + API enablement steps |
| Discover accounts/properties (readonly Admin API) |
| Create GA4 property under an account |
| Create web stream → |
| HTML snippet for a measurement ID |
| Patch a local HTML/layout file |
| Next.js |
| Write component, wire |
| Write |
| Property + stream + optional config/inject (+ optional |
| Filesystem inventory of |
| Registry projects missing GA4 config/metadata |
| Recommend html vs nextjs wiring for a repo |
| Pair with official read-only |
| Whether launcher/keymaster hooks are configured |
| Registry projects + |
| Slug and/or path → website_url, web roots, agent hints |
| Write |
Optional: launcher registry & keymaster
Public-repo safe: no hardcoded paths, no imports from sibling repos. Set env on your MCP host only if you use these services:
GA4_LAUNCHER_REGISTRY_JSON— read launcherregistry.json(same format as launcher-project-registry)GA4_LAUNCHER_REGISTRY_WRITABLE=true— allowsync_ga4_to_launcher_registry/registry_slugon provisionGA4_KEYMASTER_DATABASEorGA4_KEYMASTER_HINTS=true— status hints only; secrets stay in keymaster MCP (keymaster_register_keyfor GA service accounts). Measurement IDs remain in.ga4.config.json.
See docs/adr/0003-optional-registry-keymaster-hooks.md.
Related MCP server: MCP Google Analytics Server
Quick start
cd /path/to/ai-google-analytics-mcp
uv sync
uv run pytest -q
uv run ga4-provision-mcpAuthentication
Full walkthrough: Google Analytics GA4 Service Account Setup Guide — GCP project, enable Admin (and optional Data) API, create a service account, grant GA account access, and point GOOGLE_APPLICATION_CREDENTIALS at the JSON key.
If gcloud auth application-default login shows "This app is blocked", use a service account (recommended): see also research/notes/gcloud-this-app-is-blocked.md.
# After SA JSON is on disk and SA email has Editor on your GA account:
export GOOGLE_APPLICATION_CREDENTIALS=~/.config/ga4/ga4-provisioner-sa.jsonCopy .env.example → .env and set GOOGLE_APPLICATION_CREDENTIALS + optional GA4_DEFAULT_ACCOUNT_ID.
Hermes / MCP config (stdio)
# ~/.hermes/config.yaml (example)
mcp_servers:
ga4_provision:
command: uv
args:
- run
- --directory
- /path/to/ai-google-analytics-mcp
- ga4-provision-mcpCompanion (read-only reports):
google_analytics:
command: pipx
args: ["run", "analytics-mcp"]
env:
CLOUDSDK_CORE_PROJECT: your-gcp-project-idAgent workflow example
"Provision GA4 for this repo: production URL https://my-app.example, inject into
public/index.html, save config in project root."
The agent calls provision_project_ga4_setup with project_dir and inject_html_path.
Docs
SECURITY.md — transport (stdio), trust model, credentials, safe deployment
google-analytics-ga4-service-account-setup-guide.md — step-by-step Google Cloud + GA4 + service account setup
CONTEXT.md— rules and architectureHERMES.md— agent smoke + guardrailsdocs/adr/— durable decisionsresearch/— external references (official analytics-mcp, etc.)BRIEF.md— original Gemini conversation blueprint
Available Tools
14 toolscreate_web_data_streamC
Create a web data stream for a GA4 property. Returns measurement_id (G-XXXXXXXX). property_id: numeric or properties/.
| Name | Required | Description | Default |
|---|---|---|---|
| property_id | Yes | ||
| stream_name | Yes | ||
| website_url | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It does not disclose behavioral traits such as destructive potential, required permissions, idempotency, or error conditions. Only the return value is mentioned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise at two sentences, front-loading the purpose and return value. However, it could benefit from listing the parameters or structuring the information more clearly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given three required parameters with 0% schema description coverage, no annotations, and an output schema only hinted at, the description lacks crucial context such as parameter formats, prerequisites, and side effects. It is incomplete for a tool that creates resources.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%. The description only adds meaning for property_id (numeric or properties/<id>), but does not explain stream_name or website_url. Two of three required parameters are left entirely to the schema without hints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action 'Create a web data stream for a GA4 property' with a specific verb and resource, and mentions the return value (measurement_id). It distinguishes itself from sibling tools which focus on auth, integration, or provisioning.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs. alternatives. The sibling tools list is provided but without any comparison or context (e.g., prerequisites like having a GA4 property already).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_ga4_auth_setup_instructionsA
Return GCP/GA auth steps. Prefer service account if gcloud ADC shows 'This app is blocked'.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden. It discloses that the tool returns steps and prefers a service account under a specific condition, but does not detail what the steps include, whether authentication is required, or any side effects. This is adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with two sentences: the first clearly states the purpose, and the second adds a specific usage hint. No redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema (not shown but present), so explaining return values is unnecessary. The description, combined with the output schema, provides sufficient context for an agent. However, it could briefly mention what the auth steps cover or how they relate to other sibling tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the schema is empty and fully covered. The description adds no parameter information, but the baseline for zero parameters is 4, as there is nothing to enhance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns GCP/GA authentication steps, with a specific preference for service accounts when a certain error occurs. This distinguishes it from sibling tools like create_web_data_stream or provision_ga4_property which involve creation or provisioning.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for obtaining authentication setup instructions but does not explicitly state when to use this tool over alternatives. It provides a conditional preference but lacks clear guidance on when not to use or what distinguishes it from similar tools for auth.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_ga4_integration_statusB
Report optional launcher registry and keymaster hook availability (graceful when unset).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It mentions 'graceful when unset' hinting at non-failure behavior, but does not disclose what the tool actually returns (e.g., boolean, object with status fields). The output schema exists but the description should complement it with behavioral context like side effects or error handling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence with no unnecessary words. It front-loads the action ('Report') and resource ('availability'). Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema and zero parameters, the description covers the essential concept. However, for a tool with many siblings, more context about when to expect this to be used (e.g., after setup) would improve completeness. The description is adequate but minimal.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With zero parameters, the schema coverage is effectively 100%. Per guidelines, baseline for 0 params is 4. The description does not need to add parameter meaning, and it doesn't repeat schema info.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reports availability of optional launcher registry and keymaster hooks. The verb 'Report' and the resource 'availability' are specific. While it distinguishes from sibling tools (which are creation/management), it does not explicitly differentiate itself from similar status tools, but given the sibling list, it's clearly a status check.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. The phrase 'graceful when unset' implies safety relevance but lacks explicit usage context or exclusions. The description fails to help an agent decide to use this over other tools like list_registry_projects_for_ga4 or sync_ga4_to_launcher_registry.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
inject_ga4_gtag_into_fileB
Inject or update GA4 gtag in a local HTML/layout file (absolute path recommended). Set dry_run=true to preview without writing.
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| file_path | Yes | ||
| measurement_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It mentions dry_run for preview, but does not disclose behavior on existing gtag (update vs overwrite), file requirements, or potential side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise: two sentences, no wasted words. First sentence states purpose, second provides usage tip. Ideal front-loading.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having an output schema, the description fails to specify return behavior, error handling, or update semantics. For a file-modifying tool, this is insufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description adds value for dry_run by explaining its effect, but file_path and measurement_id are only implied without format or constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's action ('Inject or update GA4 gtag into a local HTML/layout file') with specific verb and resource, and the sibling tools like 'render_ga4_gtag_snippet' are distinct enough to avoid confusion.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives a practical tip ('absolute path recommended') and explains the dry_run option, but lacks explicit guidance on when to use this tool over alternatives or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_ga_account_summariesB
List GA account summaries and child properties (read-only Admin API).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It mentions 'read-only Admin API' indicating a safe operation, but lacks details on pagination, rate limits, or what properties exactly are returned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, front-loading the key action and including 'read-only Admin API' for behavioral context. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has only one simple parameter and an output schema (presumably detailing return values), the description is minimally adequate but could benefit from mentioning that it lists accounts and child properties.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage and the tool description does not explain the 'limit' parameter, failing to add meaning beyond the schema which already provides a default value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the verb 'List', the resource 'GA account summaries and child properties', and notes it's a read-only Admin API, clearly distinguishing it from sibling tools that focus on creation, injection, or provisioning.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for retrieving account summaries, but does not explicitly state when to use this tool versus alternatives, nor does it provide exclusions or context for when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_registry_projects_for_ga4A
List launcher registry projects with .ga4.config.json and .keymaster hints when registry env is set.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| filter_query | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must carry behavioral info. It mentions conditions (env set) and hints, but does not disclose failure modes, pagination, or ordering. Since it's a read list, it's adequate but not detailed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no wasted words. Highly concise and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given low complexity and output schema existence, description lacks clarity on what 'with .ga4.config.json and .keymaster hints' means for the output, and how filter_query interacts. Adequate but leaves gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%. Parameters 'limit' and 'filter_query' are not explained in the description. While names are suggestive, the description does not clarify what filter_query applies to (e.g., project names). No compensation for low schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb 'list', resource 'launcher registry projects', and conditions about config files and keymaster hints and env variable. It distinguishes from sibling tools like create/get/provision by focusing on listing with specific hints.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description implies usage when registry env is set, but does not explicitly state when not to use or compare with alternatives like resolve_project_for_ga4. No exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
provision_ga4_propertyC
Create a new GA4 property for a project under a GA account. account_id: numeric id only (e.g. 12345678) or accounts/12345678.
| Name | Required | Description | Default |
|---|---|---|---|
| timezone | No | Europe/London | |
| account_id | Yes | ||
| environment | No | Production | |
| project_name | Yes | ||
| currency_code | No | GBP |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must cover behavioral traits. It only mentions account_id format (numeric or accounts/). It does not disclose whether the operation is destructive, requires specific permissions, rate limits, or what the response contains. The description fails to provide meaningful behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences effectively front-load the purpose. However, the second sentence could be more structured (e.g., using bullet format). Still, no waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 5 parameters, no schema descriptions, no annotations, and an output schema that is not referenced, the description is severely incomplete. It fails to explain return values, required permissions, or usage context. A creation tool with multiple parameters needs significantly more detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% (no descriptions in input schema). The description only clarifies the format for account_id, but gives no information about project_name, timezone, environment, or currency_code. Minimal value added beyond parameter names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Create a new GA4 property for a project under a GA account.' This is a specific verb+resource, but does not distinguish from sibling tools like create_web_data_stream or scaffold_ga4_nextjs_tracking, which could be confused.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs. alternatives. No prerequisites, when-not-to-use, or context provided. The description only states what the tool does, not when it is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
provision_project_ga4_setupA
End-to-end: create property + web stream, optionally save .ga4.config.json and inject gtag. If registry_slug is set and GA4_LAUNCHER_REGISTRY_* env is configured, syncs analytics.ga4 metadata.
| Name | Required | Description | Default |
|---|---|---|---|
| timezone | No | Europe/London | |
| account_id | Yes | ||
| project_dir | No | ||
| website_url | Yes | ||
| project_name | Yes | ||
| registry_slug | No | ||
| inject_html_path | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses core behaviors (create property + web stream, optional save/inject, conditional sync), but lacks details on idempotency, error handling, or permission requirements. The key behavioral traits are present but not exhaustive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, front-loaded with the main action, and each sentence adds distinct value (core action, optional steps, conditional sync). No redundancy or unnecessary detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (7 parameters, output schema present) and the lack of parameter documentation, the description provides a high-level overview but omits important context about parameter roles, return values, and specific use cases. It is adequate for understanding scope but not for precise invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must clarify parameters. Only 'registry_slug' is mentioned in context of sync. Other critical parameters like account_id, project_name, website_url, inject_html_path, and timezone are not explained, leaving the agent to infer from names alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'End-to-end: create property + web stream, optionally save .ga4.config.json and inject gtag.' This distinguishes it from sibling tools (e.g., create_web_data_stream, provision_ga4_property) by emphasizing it is a comprehensive setup tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'End-to-end' implicitly suggests it should be used for complete GA4 provisioning, but no explicit guidance is given on when to use it over alternatives. The description does not mention exclusions or prerequisites, leaving the agent to infer usage from sibling tool names.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
render_ga4_gtag_snippetA
Return HTML gtag snippet for a measurement ID.
| Name | Required | Description | Default |
|---|---|---|---|
| measurement_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It implies a pure function with no side effects ('Return HTML gtag snippet') but does not mention validation, authentication needs, or potential failure modes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no unnecessary words. It is appropriately concise for a simple tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with one parameter and an output schema, so the description need not detail returns. However, it lacks parameter clarification and could mention that the snippet is a script tag or config object, making it less complete than ideal.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description should clarify parameter meaning. It does not explain what measurement_id is (e.g., format, example), relying solely on the schema which provides only a title.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Return' and clearly identifies the resource as 'HTML gtag snippet for a measurement ID.' It is distinct from sibling tools like inject_ga4_gtag_into_file and render_ga4_nextjs_component.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide explicit guidance on when to use this tool versus alternatives. However, sibling tool names offer some contextual differentiation, implying this tool returns the snippet as a string rather than injecting into a file.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
render_ga4_nextjs_componentA
Return a Next.js client component (next/script) for GA4. mode: env (read NEXT_PUBLIC_GA_MEASUREMENT_ID) or inline (embed id). consent_gated: only load gtag after localStorage cookie consent is accepted.
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | env | |
| consent_gated | No | ||
| measurement_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It discloses that the tool returns a component and explains parameter behaviors, but omits details like side effects, permissions, or response format. The output schema exists, partially mitigating the lack of return-value description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise: two sentences, front-loaded with purpose, then param details. Every word earns its place. No fluff. Ideal for quick agent consumption.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity and the presence of an output schema (which defines return structure), the description is almost complete. It covers all params and the core behavior. Minor gaps: no mention that it requires a Next.js project or that the component is a string/JSX, but these are implied by the context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage, so description must compensate. It explains 'mode' (env vs inline) and 'consent_gated' (localStorage condition) in plain language. 'measurement_id' is not detailed but is self-explanatory. The description adds meaningful context beyond the schema's property names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it returns a Next.js client component using next/script for GA4, with explicit distinction from sibling tools like render_ga4_gtag_snippet (which produces a snippet) and inject_ga4_gtag_into_file (which injects into existing code). The verb 'return' and resource 'Next.js client component' are specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when a Next.js component is needed, but lacks explicit guidance on when NOT to use it or comparison to alternatives. Sibling tools like render_ga4_gtag_snippet and inject_ga4_gtag_into_file exist, but no direct usage boundaries are set.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve_project_for_ga4C
Resolve registry slug and/or filesystem path for GA4 provisioning (paths, website_url, agent hints).
| Name | Required | Description | Default |
|---|---|---|---|
| slug | No | ||
| project_dir | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must disclose behaviors. It mentions resolution but omits whether the tool reads data, modifies state, requires authentication, or is idempotent. The lack of any behavioral details is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is a single efficient sentence with parenthetical details. It is relatively concise but the structure could be improved by separating input/output concerns.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has two optional parameters, a complex resolution task, and an output schema, the description is insufficient. It lacks details on what the tool returns, side effects, and how to interpret results. More comprehensive documentation is needed for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage, so description should clarify parameters. It mentions 'registry slug' and 'filesystem path' which likely correspond to slug and project_dir, but does not explicitly map them or explain their roles. The parenthetical '(paths, website_url, agent hints)' suggests outputs, not inputs, adding confusion.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool resolves registry slug and/or filesystem path for GA4 provisioning, and mentions additional outputs (paths, website_url, agent hints). It distinguishes this resolution step from sibling tools focused on creation, listing, or provisioning. However, the verb 'resolve' is somewhat vague and could be more specific.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description does not provide any guidance on when to use this tool versus alternatives like list_registry_projects_for_ga4 or provision_ga4_property. No mentions of prerequisites or context for invocation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
save_project_ga4_configB
Write .ga4.config.json in a project root for agents and humans to reference later.
| Name | Required | Description | Default |
|---|---|---|---|
| extra | No | ||
| project_dir | Yes | ||
| property_id | Yes | ||
| stream_name | No | ||
| website_url | Yes | ||
| measurement_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It only says 'write', but does not disclose whether it overwrites an existing file, error handling, permissions required, or side effects. For a mutation tool, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very concise at 14 words in one sentence, but it sacrifices necessary detail. While front-loaded, it doesn't earn its place fully due to lack of parameter or behavioral info.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (6 params, output schema exists), the description is too sparse. It doesn't explain the output (likely file path or success), doesn't clarify that the config is for GA4, and omits important context for a data-writing tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 6 parameters with 0% description coverage, and the description adds absolutely no information about any parameter. The agent is left without guidance on what each parameter means or how to use them.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (write), the resource (.ga4.config.json), and the purpose (for agents and humans to reference later). It distinguishes well from siblings like inject_ga4_gtag_into_file or render_ga4_gtag_snippet which are about code injection, not config writing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when saving configuration for later reference, but it does not explicitly state when to use this tool versus alternatives like provision_ga4_property or sync_ga4_to_launcher_registry. No exclusion criteria or context provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
scaffold_ga4_nextjs_trackingB
Scaffold GA4 for a Next.js app: write GoogleAnalytics.tsx, wire layout.tsx, and set NEXT_PUBLIC_GA_MEASUREMENT_ID in .env.local (when mode=env). web_root must be the Next.js package root (directory containing package.json).
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | env | |
| dry_run | No | ||
| web_root | Yes | ||
| consent_gated | No | ||
| measurement_id | Yes | ||
| layout_relative | No | src/app/layout.tsx |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description discloses that it writes GoogleAnalytics.tsx, modifies layout.tsx, and sets .env.local when mode=env. However, it does not state whether files are overwritten, if the operation is idempotent, or any side effects. With no annotations, the description partially covers behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no redundancy. Directly states the action and a critical constraint. All words serve a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 6 parameters, 0% schema descriptions, and no annotations, the description lacks detail on parameter semantics and behavioral completeness. It does not explain behavior on conflict, authentication needs, or output structure despite having an output schema. The tool modifies files, but the description omits important context like error handling.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage, so description must explain all parameters. It only explains web_root and partially measurement_id and mode. Parameters dry_run, consent_gated, and layout_relative are not mentioned at all, leaving 4 out of 6 parameters undocumented in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly identifies the tool as scaffolding GA4 for a Next.js app, specifying files to write and env variable. However, it does not differentiate from sibling tools like render_ga4_nextjs_component or inject_ga4_gtag_into_file, which also handle similar tasks.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Only implicit guidance is provided: web_root must be the Next.js package root. No explicit when-to-use or when-not-to-use compared to siblings, and no mention of prerequisites like having a Next.js project already set up.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sync_ga4_to_launcher_registryA
Write GA4 metadata to launcher registry project.analytics.ga4 (requires writable env).
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | ||
| property_id | Yes | ||
| stream_name | No | ||
| website_url | No | ||
| measurement_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so description must carry behavioral disclosure. It indicates a write operation and a necessary environment condition. However, it lacks details about idempotency, overwrite behavior, failure modes, or effect on existing data.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is one short sentence (15 words) that is front-loaded and efficient. Every word adds value, no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 5 parameters, no annotations, and an output schema that may cover return values but is not referenced, the description is incomplete. It fails to explain parameters, error cases, or usage context beyond the environment requirement.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not explain any of the 5 parameters (slug, property_id, stream_name, website_url, measurement_id). The agent has no guidance on what each parameter means or how to fill them.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool writes GA4 metadata to a specific destination (launcher registry project.analytics.ga4), using precise verb and resource. It distinguishes from sibling tools that deal with different aspects of GA4 integration.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions a prerequisite ('requires writable env'), providing clear context for usage. However, it does not explicitly state when not to use this tool or compare to alternatives, missing a complete guideline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
14 tool updates
v0.1.0- First observed
create_web_data_stream - First observed
get_ga4_auth_setup_instructions - First observed
get_ga4_integration_status - First observed
inject_ga4_gtag_into_file - First observed
list_ga_account_summaries - First observed
list_registry_projects_for_ga4 - First observed
provision_ga4_property - First observed
provision_project_ga4_setup - First observed
render_ga4_gtag_snippet - First observed
render_ga4_nextjs_component - First observed
resolve_project_for_ga4 - First observed
save_project_ga4_config - First observed
scaffold_ga4_nextjs_tracking - First observed
sync_ga4_to_launcher_registry
TDQS
Most tools have distinct purposes (e.g., creating a property vs. creating a web stream vs. scaffolding Next.js). However, provision_ga4_property and provision_project_ga4_setup partially overlap, but descriptions clarify the latter is end-to-end.
Tool names consistently use snake_case and follow a verb_noun pattern (e.g., create_, get_, list_, provision_). Minor inconsistency between 'get' and 'list' for similar lookup operations, but overall patterns are predictable.
14 tools cover the GA4 provisioning and integration domain without unnecessary redundancy. Each tool addresses a specific task, and the count feels well-scoped for a focused server.
The tool set covers the main lifecycle: listing accounts, creating properties and streams, injecting gtags, and scaffolding Next.js. Missing update/delete operations, but these are less common in initial setup workflows.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
SEO & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Embed an AI chat widget on your website from your coding agent: provision, configure, get snippet.
Connect Google Analytics to ChatGPT. Query GA4 data in plain English and get instant insights.
Generate 18 AI readiness files (llms.txt, ai.txt, RAG indexes, schema) for any website.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Analytics APIs to fetch reports, manage properties, data streams, conversion events, and custom dimensions/metrics through OAuth2 authentication.636MIT
- AlicenseAqualityAmaintenanceEnables comprehensive integration with Google Analytics 4, allowing users to read analytics reports and send custom events through both the Data API and Measurement Protocol v2.266072MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Google Analytics 4 data, providing tools for historical reporting, real-time activity monitoring, and property management. It supports secure service account authentication to access metrics like traffic summaries, user acquisition, and custom dimensions.MIT
- AlicenseAqualityCmaintenanceEnables LLMs to interact with Google Analytics Admin and Data APIs to retrieve account summaries, property details, and custom metrics. It allows users to run core and real-time reports to analyze website performance and configuration via natural language.71Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/HappyMonkeyAI/ai-google-analytics-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server