Google Analytics MCP Server
The Google Analytics MCP Server connects AI agents and copilots to Google Analytics 4 for live data queries, schema discovery, and troubleshooting.
Query GA4 Data (get_ga4_data): Retrieve analytics data by specifying dimensions (e.g., date, city), metrics (e.g., totalUsers, sessions), date ranges, and filters — with built-in data volume protection, automatic server-side aggregation, and intelligent sorting.
Discover Schema:
search_schema: Keyword-search across 200+ GA4 dimension and metric API names.get_property_schema: Retrieve the complete list of dimensions and metrics — including custom ones — for your GA4 property.list_dimension_categories/get_dimensions_by_category: Browse dimension categories (e.g., Geography, Traffic Source, Device).list_metric_categories/get_metrics_by_category: Browse metric categories (e.g., User, Session, Revenue, Event).
Self-Healing Troubleshooting (get_troubleshooting_guide): Fetch live troubleshooting guides for setup issues, IAM/403 errors, or schema/filter errors — enabling AI agents to autonomously self-correct.
Smart Features:
Metric Auto-Aliasing: Maps legacy or common metric names (e.g.,
conversions→keyEvents) to prevent query failures.Data Volume Protection: Estimates row counts before executing large queries (>2,500 rows) to avoid overloading model context windows.
Server-Side Aggregation: Automatically computes property-level totals for non-time-series queries.
Multi-Platform Support: Works with Claude, ChatGPT, Gemini, Cursor, VS Code, and OpenClaw, installable via npm, PyPI, Homebrew, or a one-line script. Connects securely using Google Cloud Service Account credentials.
Provides access to Google Ads data within Google Analytics 4, allowing queries about campaign, ad group, and keyword performance.
Connects to Google Analytics 4 data, enabling natural language queries about website traffic, user behavior, and analytics with access to 200+ GA4 dimensions and metrics.
Uses Google Cloud for service account creation and API access to connect with Google Analytics data.
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., "@Google Analytics MCP Servershow me last week's top 5 pages by pageviews"
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.
Google Analytics 4 (GA4) MCP Server 📊
Model Context Protocol (MCP) server for Google Analytics 4: real-time query exploration, schema discovery, metric aggregation, and audience insights for AI agents.
🌐 Live Documentation & Web Portal: https://ga4.builditwithai.xyz
⚡ Quickstart
# 1-Line Universal Installer (Auto-configures Claude Desktop, Cursor, Claude Code, Antigravity, VS Code, Zed, Windsurf)
curl -fsSL "https://ga4.builditwithai.xyz/install" | bash
# Or run directly via your preferred runtime:
uvx google-analytics-mcp
uvx --from google-analytics-mcp ga4-mcp-server
python -m ga4_mcp
npx -y @surendranb/google-analytics-mcpRelated MCP server: GA4 MCP Server
🤖 Client Setup
A. Claude Code (CLI)
claude mcp add google-analytics -- uvx google-analytics-mcpB. Cursor & Google Antigravity (mcp.json)
{
"mcpServers": {
"google-analytics": {
"command": "uvx",
"args": ["google-analytics-mcp"]
}
}
}C. Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"google-analytics": {
"command": "uvx",
"args": ["google-analytics-mcp"],
"env": {
"GA4_PROPERTY_ID": "your_ga4_property_id",
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service_account.json"
}
}
}
}D. VS Code (Cline / Roo Code / Continue)
{
"mcpServers": {
"google-analytics": {
"command": "npx",
"args": ["-y", "@surendranb/google-analytics-mcp"]
}
}
}🛠️ Tools & Capabilities
Tool Name | Parameters | Description | Return Type |
|
| Runs multi-dimensional GA4 reports with automated metric totals and server-side aggregation. |
|
| (none) | Lists all accessible Google Analytics accounts and permission levels. |
|
|
| Lists all GA4 properties associated with an account. |
|
|
| Fetches complete dimension and metric schemas, custom definitions, and compatibility rules. |
|
|
| Queries real-time active users and event counts from the last 30 minutes. |
|
|
| Searches built-in GA4 analytical playbooks (e-commerce, channel attribution, bot filtering). |
|
|
| Dynamically loads procedural skills and analytical guides from GitHub. |
|
| (none) | Lists all available live GA4 analytical skills. |
|
🧠 Dynamic Skills & Guided Playbooks
This server ships with built-in analytical recipes that load dynamically from GitHub:
traffic-diagnosis: Step-by-step root cause analysis for sudden traffic drops.channel-acquisition: Best-practice channel grouping and attribution modeling.ecommerce-analysis: Revenue, item purchase rate, and conversion funnel analysis.ai-referral-analysis: Tracks and isolates referral traffic from ChatGPT, Claude, Perplexity, and Gemini.
🔒 Telemetry & Privacy
This package collects anonymous, non-PII diagnostic telemetry (command executions, latency, error codes) to improve tool reliability. No queries, user credentials, personal data, source code, or environment variables are ever collected or stored.
You can opt out anytime by setting either of the following environment variables:
export DO_NOT_TRACK=1
# or
export MCP_TELEMETRY_OPT_OUT=1📄 License
MIT License. See LICENSE for details.
Available Tools
10 toolsget_dimensions_by_categoryARead-onlyIdempotent
Return all dimensions in a specific category with their API names and descriptions.
Returns: {"dimension_api_name": "description", ...}
The category name must exactly match a value returned by list_dimension_categories. Use search_schema instead if you already have a keyword — it is faster and more targeted than browsing by category.
Args: category: Exact category name from list_dimension_categories (case-insensitive).
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations already declare readOnlyHint and idempotentHint, and the description does not contradict them. The description adds a performance note about search_schema being 'faster and more targeted', which provides useful context beyond the annotations. However, it does not describe any additional side effects or requirements like authentication or rate limits, which would have enhanced transparency further.
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 well-structured and concise. It opens with the purpose, then describes the return format, provides usage guidance, and closes with parameter details. Each sentence contributes value without unnecessary fluff, making it easy to parse and act upon.
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 simplicity (single parameter, no output schema), the description is complete. It covers the return structure, parameter constraints, and alternative tool recommendation, providing sufficient context for an agent to decide when and how to use it. No critical information is missing.
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 only defines 'category' as a string, but the description enriches it by specifying that it must be an exact category name from list_dimension_categories and is case-insensitive. This adds crucial semantic detail beyond the schema, ensuring the agent understands the parameter's constraints and origin.
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 that the tool returns all dimensions in a specific category with their API names and descriptions. It distinguishes from the sibling get_metrics_by_category by focusing on dimensions and explicitly mentions an alternative tool (search_schema) for keyword-based searches, making its purpose 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 provides explicit usage guidance: it requires an exact category name from list_dimension_categories and suggests using search_schema instead when a keyword is available, noting it is faster and more targeted. This clearly indicates when to use this tool versus alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_ga4_dataARead-onlyIdempotent
Retrieve GA4 data with built-in intelligence for better and safer results.
Returns on success: {"data": [...], "metadata": {...}, "_skills_tip": "..."}. For multi-row pulls (a time series like ['date'], or any breakdown) the result also carries "totals": {metric: value} — GA4 server-side aggregates across all rows. Read the period figure from "totals"; do NOT sum the rows yourself. (Additive metrics sum; rate metrics are period-computed by GA4.) Returns on volume warning: {"warning": "...", "estimated_rows": N, "suggestions": [...]} Returns on error: {"error": "..."}
CRITICAL WORKFLOW — follow this sequence every time:
DISCOVER FIELDS: NEVER guess dimension or metric names. Call
search_schema,list_dimension_categories, orlist_metric_categoriesFIRST to verify exact API names for this property. Guessing costs you a failed round-trip.DISCOVER PATTERN: For any domain-specific analysis, call
search_skills('<topic>')BEFORE querying to get the proven methodology — correct dimensions, metrics, filters, and how to interpret the result. One extra call prevents multiple failures. Use for: traffic diagnosis, attribution, ecommerce, channel acquisition, content performance, geo/device segmentation, AI referrals, bot detection.RETRIEVE: Call get_ga4_data with the verified fields and the skill's pattern.
TROUBLESHOOT: On schema error, invalid field, or filter parse error — do NOT retry by guessing. Your training may predate current GA4 (UA was sunset 2023-07-01). Call
search_schema('<keyword>')to find the current name in THIS property, orsearch_skills('ua-to-ga4' | 'common-metric-names' | 'filter-structures')for the mapping.
FIELD NAMES — GA4 API names vs common wrong guesses:
'screenPageViews' not 'uniquePageviews' or 'pageViews'
'totalUsers' not 'users'
'keyEvents' not 'conversions' or 'goalCompletionsAll'
'sessionKeyEventRate' not 'sessionConversionRate' or 'conversionRate' (GA4 renamed conversions→key events, 2024)
'userEngagementDuration' not 'timeOnPage' or 'avgTimeOnPage'
'averageSessionDuration' not 'avgSessionDuration'
'itemsViewed' not 'itemViews'
'ecommercePurchases' not 'purchases'
'sessionDefaultChannelGroup' not 'sessionDefaultChannelGrouping'
'sessionSource'/'sessionMedium' not 'source'/'medium'
All names are camelCase — never snake_case (page_path → pagePath, event_name → eventName)
'bounceRate' and 'newUsers' are correct as-is
DATE RANGES:
Format: 'YYYY-MM-DD' or relative strings: '7daysAgo', '30daysAgo', 'yesterday', 'today'
'NdaysAgo' counts back from today, excluding today. 'yesterday' = last complete day.
Period comparison (YoY, WoW): run two separate queries with different date ranges, then compare the results. The API does not support multi-period in one call.
SCOPE RULES — incompatible combinations return a 400 error:
Session dims (sessionSource, sessionMedium, sessionCampaignName) → use with sessions, bounceRate, sessionKeyEventRate. NOT with eventCount.
Event dims (eventName) → use with eventCount. NOT with sessions.
User dims (firstUserSource, firstUserMedium) → use with totalUsers, newUsers. NOT sessions.
Safe with any metric: date, deviceCategory, country, city, pagePath, pageTitle.
FILTER STRUCTURE:
Simple: {"filter": {"fieldName": "sessionSource", "stringFilter": {"value": "google", "matchType": "CONTAINS"}}}
AND: {"andGroup": {"expressions": [{"filter": {...}}, {"filter": {...}}]}}
OR: {"orGroup": {"expressions": [{"filter": {...}}, {"filter": {...}}]}}
NOT: {"notExpression": {"filter": {...}}}
Wrong keys that break filters: and_filter→andGroup, or_filter→orGroup, not_filter→notExpression, filters→expressions, field→fieldName
Args: dimensions: GA4 dimension names (verified via schema tools, e.g. ["date", "city"]). metrics: GA4 metric names (verified via schema tools, e.g. ["totalUsers", "sessions"]). date_range_start: Start date — 'YYYY-MM-DD' or '7daysAgo', '30daysAgo', 'yesterday'. date_range_end: End date — 'YYYY-MM-DD' or 'yesterday', 'today'. dimension_filter: Optional FilterExpression dict. camelCase and snake_case both accepted. limit: Max rows to return. Defaults to 1000. estimate_only: If True, returns only estimated row count without fetching data. proceed_with_large_dataset: Set True to bypass the 2500-row volume warning. enable_aggregation: If True, asks GA4 for server-side metric totals whenever a dimension splits the data across rows (e.g. a 7-day ['date'] pull), returned in a "totals" block so the model needn't sum rows. Default True. intent: Short plain-English description of what the user is trying to learn. E.g. "which channels drive most signups", "bot traffic audit for last month".
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| intent | No | ||
| metrics | No | ||
| dimensions | No | ||
| estimate_only | No | ||
| date_range_end | No | yesterday | |
| date_range_start | No | 7daysAgo | |
| dimension_filter | No | ||
| enable_aggregation | No | ||
| proceed_with_large_dataset | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations (readOnlyHint, openWorldHint, idempotentHint) are consistent with the description's read-only nature. The description goes further by explaining the volume warning, estimate_only behavior, enable_aggregation with totals, and error handling, all without contradicting the annotations.
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?
Despite its length, the description is well-structured with clear sections (FIELD NAMES, DATE RANGES, SCOPE RULES, FILTER STRUCTURE, CRITICAL WORKFLOW). Each section addresses a specific challenge (naming pitfalls, date formats, incompatibilities, filter syntax), and no sentence is extraneous. The front-loaded purpose and workflow efficiently guide the agent.
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 description is exceptionally complete for a complex GA4 API. It covers not only how to call the tool but also the prerequisite discovery steps, common mistakes, output structure (totals, warnings), and error recovery. There is no output schema, but the description clearly outlines what returns are expected, ensuring the agent has sufficient 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?
With 0% schema description coverage, the description compensates fully by explaining all 10 parameters: dimensions, metrics, date ranges, filter structure, limit, estimate_only, proceed_with_large_dataset, enable_aggregation, and intent. It provides formats, examples, and scope rules, making each parameter's meaning and usage clear.
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: to retrieve GA4 data with built-in intelligence. It distinguishes itself from sibling tools (like search_schema) by focusing on data retrieval, and the workflow section explicitly positions it as the final step after schema discovery.
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 'CRITICAL WORKFLOW' section tells the agent to call search_schema and search_skills before using this tool, making the appropriate usage context explicit. It also provides detailed rules for date ranges, scope compatibility, and filter structure, guiding when and how to invoke the tool effectively.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_metrics_by_categoryARead-onlyIdempotent
Return all metrics in a specific category with their API names and descriptions.
Returns: {"metric_api_name": "description", ...}
The category name must exactly match a value returned by list_metric_categories. Use search_schema instead if you already have a keyword — it is faster and more targeted than browsing by category.
Args: category: Exact category name from list_metric_categories (case-insensitive).
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint true, and the description adds return format context without contradicting annotations. It doesn't mention side effects, but read-only is implied and covered.
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?
Concise and well-structured: clear purpose, return format, usage note, and parameter explanation are all included without 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?
Despite lacking an output schema, the description explicitly states the return format (dictionary mapping). It also provides source for category names and differentiates from alternative tools, covering all necessary 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?
The schema only specifies type string, but the description adds crucial semantics: it must be an exact category name from list_metric_categories and is case-insensitive, fully clarifying the parameter's meaning.
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?
States clearly that it returns all metrics in a specific category with API names and descriptions, and distinguishes from sibling tools like search_schema and get_dimensions_by_category.
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?
Provides explicit prerequisite (category must exactly match list_metric_categories) and recommends search_schema as a faster alternative for keyword searches, offering clear when-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_property_schemaARead-onlyIdempotent
Returns the complete schema for the configured GA4 property, including all available dimensions and metrics (standard and custom). Warning: This can be a very large object (10k+ tokens). Use search_schema for most discovery tasks.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare the tool read-only and idempotent. The description adds valuable behavioral context by warning about the very large object size and clarifying the scope (complete schema including standard and custom dimensions/metrics). No contradiction with annotations.
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 efficient sentences: the first conveys the core purpose, the second adds a critical warning and points to an alternative. Every word earns its place with 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?
For a zero-parameter, no-output-schema tool with strong annotations, the description fully covers the essential context: what it returns, the size caveat, and the alternative for lighter-weight tasks. Nothing missing.
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, and schema coverage is trivially 100%. The description adds no parameter detail because none exist, but it clearly explains what the return object contains, which is sufficient for a parameterless tool.
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 the complete schema for the configured GA4 property, including all dimensions and metrics. It distinguishes itself from siblings by explicitly noting it returns the full schema and pointing to search_schema for most discovery 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?
Explicit guidance is provided: the warning about large size (10k+ tokens) signals caution, and 'Use search_schema for most discovery tasks' names the alternative and indicates when not to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_troubleshooting_guideARead-onlyIdempotent
Returns the troubleshooting/setup guide for a topic, served from inside the server (no network needed). Use whenever you hit a schema error, dimension_filter parse error, IAM / 403 authorization error, or a boot-time setup error.
Args: topic: One of "setup", "iam", or "schema".
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is clear. The description adds useful context beyond annotations by noting the content is 'served from inside the server (no network needed),' which helps the agent understand latency and availability characteristics.
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 compact, front-loaded with the primary purpose, and uses a short Args block. Every sentence adds value: what it does, where it comes from, when to use it, and the valid topic values.
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?
With one required parameter, explicit valid values, clear trigger scenarios, and an output schema already provided, the description covers all essential decision points. The agent can select and invoke this tool correctly without needing additional 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?
The input schema provides only the parameter name and type with no descriptions, so the description fully compensates by listing the valid values: 'setup', 'iam', or 'schema'. It also maps these to error classes in the usage guidance, making the parameter semantics actionable despite 0% schema description 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?
The description uses a specific verb ('Returns') and a clear resource ('troubleshooting/setup guide for a topic'), plus a defined topic parameter. This distinguishes it from sibling schema/list/search tools by focusing on error-resolution guides rather than data retrieval or schema discovery.
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 explicitly says 'Use whenever you hit a schema error, dimension_filter parse error, IAM / 403 authorization error, or a boot-time setup error,' giving concrete trigger conditions. It does not mention when not to use the tool or name alternatives, so it stops short of a full 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_dimension_categoriesARead-onlyIdempotent
List all dimension categories for this GA4 property, with a count of dimensions in each category.
Returns: {"dimension_categories": {"Category Name": count, ...}}
Use this as the first step in dimension exploration — browse categories, then call get_dimensions_by_category with the name that fits your analysis. Use search_schema instead if you already have a keyword to search for.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true, so the description does not need to repeat safety traits. It adds valuable behavioral context by showing the exact return shape (a map of category to count), which is especially useful given no output schema is present.
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?
Three sentences, each with a distinct purpose: what it does, what it returns, and how to proceed. The description is front-loaded and contains no filler or redundant repetition of the tool name.
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?
For a zero-parameter read-only list tool, the description covers the action, the return format, and the workflow with sibling tools. Annotations cover safety, and the return example compensates for the missing output schema. Nothing essential is omitted.
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 parameter semantics are inherently simple. The baseline is 4, and the description correctly focuses on behavior rather than inventing parameter explanations.
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 ('List all dimension categories') and clearly specifies the resource (GA4 property) and the added value (count of dimensions per category). It is easily distinguished from siblings like list_metric_categories and get_dimensions_by_category.
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 explicitly states when to use this tool ('first step in dimension exploration'), what to do next ('call get_dimensions_by_category'), and names an alternative (search_schema) for keyword-driven searches. This is exemplary usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_metric_categoriesARead-onlyIdempotent
List all metric categories for this GA4 property, with a count of metrics in each category.
Returns: {"metric_categories": {"Category Name": count, ...}}
Use this as the first step in metric exploration — browse categories, then call get_metrics_by_category with the name that fits your analysis. Use search_schema instead if you already have a keyword to search for.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and idempotentHint, and the description adds the exact return shape (metric_categories map with counts). It does not hide any mutation, side effects, or auth requirements; the behavior is fully transparent for a zero-parameter read operation.
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 compact and front-loaded: purpose, return value, then usage alternatives. Every sentence earns its place, and the JSON return example is provided without unnecessary elaboration.
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?
Even without an output schema, the description tells the agent exactly what to expect in the response. For a simple, read-only, no-argument listing tool, it covers purpose, output format, and related next steps, making it self-contained.
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 and the input schema is empty, so there is no parameter mapping for the description to enhance. Per the baseline rule for 0-parameter tools, a 4 is appropriate because the description correctly treats the operation as parameterless.
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 ('List'), names the exact resource ('metric categories'), and scopes it to 'this GA4 property' with an added count of metrics. It clearly distinguishes itself from siblings like list_dimension_categories and get_metrics_by_category.
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 explicitly says to use this as the first step in metric exploration, then directs the agent to get_metrics_by_category for browsing a chosen category. It also names search_schema as the better alternative when a keyword is already known, giving concrete when-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_schemaARead-onlyIdempotent
Search for a keyword across all dimensions and metrics for this property. Returns a ranked list of up to 10 matching fields scored by relevance.
Returns: {"top_results": {"DIMENSION: api_name": score, "METRIC: api_name": score, ...}}
Use this when you have a concept ("engagement", "revenue", "channel") and need exact API field names before calling get_ga4_data. Use list_dimension_categories or list_metric_categories instead if you want to browse all available fields without a specific keyword.
Args: keyword: One or more keywords to search for (e.g., "user", "campaign revenue").
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnly and idempotent hints are present in annotations, and the description adds useful behavioral detail: results are ranked by relevance, limited to 10 matching fields, and returned in a specific top_results wrapper. This goes beyond the structured annotations and clearly informs the agent what will happen.
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 compact and well-structured: it opens with the core operation, then shows the return format, gives usage guidance, and closes with parameter semantics. Every line contributes value, with no filler or unnecessary repetition.
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?
Even though there is no output schema, the description explicitly provides the return shape and result structure. It also covers invocation purpose, parameter semantics, and alternatives. For a simple single-parameter, read-only search tool, the description is fully adequate and self-contained.
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 description coverage is 0%, but the description fully compensates by explaining the keyword parameter's meaning ('One or more keywords') and giving concrete examples ('user', 'campaign revenue'). This makes the single parameter semantically clear even though the schema itself is minimal.
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 a specific action ('Search for a keyword across all dimensions and metrics'), identifies the resource, and explains the ranked result of up to 10 fields with relevance scores. It also differentiates itself from sibling browsing tools by explicitly naming alternatives, making the purpose sharp.
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 explicitly says when to use this tool: when you have a concept and need exact API field names before calling get_ga4_data. It also names the alternatives (list_dimension_categories, list_metric_categories) when the user wants to browse without a specific keyword, which is strong decision guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_skillsARead-onlyIdempotent
Fetch analytical recipes and how-to guides from the GA4 skills library.
Skills are domain-specific playbooks for common GA4 analysis patterns — exact dimensions, metrics, filters, and interpretation logic for each use case. Call this BEFORE querying get_ga4_data for any domain-specific analysis.
Available skills: traffic-diagnosis, attribution-scope, channel-acquisition, content-performance, geo-device-segmentation, ecommerce-analysis, ai-referral-analysis, bot-traffic-detection, common-metric-names, filter-structures, custom-dimensions, compatible-combinations, ua-to-ga4, date-ranges, ga4-limitations.
Usage:
search_skills("") → returns full index of all skills
search_skills("ecommerce") → returns the ecommerce-analysis skill
search_skills("ua-to-ga4") → returns the UA→GA4 field name mapping
Args: query: A skill name (exact slug) or empty string to browse the full index.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, openWorldHint=true, and idempotentHint=true, so the safety profile is clear. The description adds behavioral context by explaining that it returns a full index when given an empty string and specific skills when given a slug, and it notes that skills contain exact dimensions, metrics, filters, and interpretation logic. This goes beyond the annotations by clarifying the tool's output behavior and its role in the workflow.
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 well-structured and front-loaded: it starts with the purpose, then explains usage, lists available skills, and provides examples. Every sentence adds value, and the usage examples are concise and clear. It is appropriately sized for the tool's complexity.
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 simplicity (one parameter, no nested objects) and the presence of an output schema, the description is complete. It covers the purpose, usage, available skills, and examples. The output schema likely describes the return structure, so the description doesn't need to explain return values. The description fully equips the agent to use the tool correctly.
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 only one parameter 'query' with no description, and schema description coverage is 0%. The description compensates by explaining that the query is a skill name (exact slug) or an empty string to browse the full index, and provides usage examples. This adds significant meaning beyond the bare schema, though it could be slightly more explicit about the exact format (e.g., case sensitivity).
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 fetches analytical recipes and how-to guides from the GA4 skills library, with a specific verb ('Fetch') and resource ('GA4 skills library'). It distinguishes itself from siblings by explicitly instructing to call it BEFORE get_ga4_data for domain-specific analysis, and lists available skills, making its purpose 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 provides explicit usage guidance: it says to call this tool before querying get_ga4_data for any domain-specific analysis, and gives concrete examples of how to use it (empty string for full index, exact slug for specific skill). It also lists all available skills, which helps the agent decide when to use it. This is strong guidance that differentiates it from alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
setup_ga4_accessARead-onlyIdempotent
Interactively fix a broken GA4 MCP setup (missing property ID, missing or expired credentials, or missing GA4 access) by asking the user for the needed input through the client, then re-initializing without a restart. Call this whenever a configuration or authentication error is reported.
| 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?
Annotations include readOnlyHint=true, openWorldHint=true, idempotentHint=true, which align with the description's interactive and re-initializing nature. The description adds context that it interacts with the user and re-initializes without a restart, which goes beyond annotations, but doesn't disclose potential side effects or details of the interaction.
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?
Compact, two-sentence description. Immediate front-loaded purpose, followed by actionable trigger condition. No filler.
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 zero parameters and a true output schema, the description is sufficient. It explains the interactive process, trigger conditions, and that it re-initializes without restart. Could detail the exact steps or user prompts, but openWorldHint suggests flexible behavior; completeness is adequate.
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, and the description explains it works by asking the user for needed input through the client. This adds value by clarifying that no schema parameters are needed and the tool handles collection dynamically.
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: to fix a broken GA4 MCP setup by asking for missing inputs and re-initializing. It distinguishes itself from data retrieval tools by focusing on configuration/auth errors, but doesn't explicitly name a sibling alternative.
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?
Explicitly directs when to use: 'Call this whenever a configuration or authentication error is reported.' This is clear guidance and context, though it doesn't discuss when not to use, but the trigger condition is enough for typical use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Tools are clearly separated into distinct categories: schema exploration (search_schema, list/get dimension/metrics), data retrieval (get_ga4_data), and support (troubleshooting, skills, setup). No two tools have overlapping purposes, and each tool's description specifies when to use alternatives.
All tool names follow a consistent verb_noun pattern with underscores (e.g., search_schema, list_dimension_categories, get_ga4_data). Verbs like search, list, get, setup are used predictably, and there is no mixing of camelCase or other conventions.
The 10 tools are well-scoped for a GA4 analytics server, covering schema discovery, data retrieval, troubleshooting, analytical skills, and setup. Each tool serves a clear purpose without redundancy or unnecessary bloat.
The tool set covers the full workflow for GA4 data analysis: discover fields (via search or category browsing), retrieve data with intelligent patterns, access troubleshooting guides, fetch analytical recipes, and fix setup issues. No obvious gaps for the intended use case.
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
Connect Google Analytics to ChatGPT. Query GA4 data in plain English and get instant insights.
Query your Betterlytics web analytics from AI agents: traffic, funnels, journeys, errors, uptime.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Read-only analytics for Convex apps, queryable via MCP from Claude, Cursor, and other clients.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables LLM applications to query Google Analytics 4 data through standard MCP interfaces, supporting real-time data, custom reports, and metadata discovery.5781MIT
- AlicenseAqualityBmaintenanceConnects MCP clients like Claude Desktop to Google Analytics 4 Data API, enabling natural language queries for reports, top pages, traffic sources, conversions, realtime users, and period comparisons.7MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying Google Analytics 4 data using natural language through MCP clients like Claude and Cursor, supporting 200+ dimensions and metrics for traffic, user behavior, and e-commerce analysis.MIT
- FlicenseNot gradedqualityDmaintenanceEnables interactive Google Analytics 4 visualizations inside Claude conversations, supporting ad-hoc queries with line, bar, pie charts and data tables.
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/surendranb/google-analytics-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server