Skip to main content
Glama
onionst
by onionst

GA4 Toolkit

CI License: MIT

A Python CLI and MCP server for read-only Google Analytics 4 reports. It provides daily summaries, top pages, acquisition, events, realtime activity, metadata, and custom reports through the Google Analytics Data and Admin APIs.

Why use it?

Use the same reporting client in shell scripts and MCP conversations. Common reports have ready-made commands, and results export as tables, JSON, or CSV.

This is an independent community project. Google maintains an official Analytics MCP server. This toolkit focuses on a small CLI and reusable report presets alongside MCP. It is an early release; see the limits below before using it for bulk exports.

Related MCP server: GA4 MCP Server

Install

Requires Python 3.11 or newer and uv.

git clone https://github.com/onionst/ga4-toolkit.git
cd ga4-toolkit
uv tool install .
ga4 --version

Installation provides the ga4 and ga4-mcp commands. To update an existing installation after pulling changes, run uv tool install --force .. There is no PyPI release; install from this repository. If upgrading from the earlier private package, uninstall that package first with uv tool uninstall ga4-codex-toolkit, then install this one.

Try the output format without a Google account:

uv sync --locked
uv run --locked python examples/offline_report.py

The example uses synthetic data and shows a report with two returned rows out of three, including its truncation warning.

Authentication

Enable the Google Analytics Data API and Google Analytics Admin API in the Google Cloud project used for authentication. The Google identity must have access to the target GA4 property; the Viewer role is sufficient for reports.

The client checks credentials in this order:

  1. A service-account JSON key referenced by GOOGLE_APPLICATION_CREDENTIALS.

  2. ~/.config/ga4-cli/google-credentials.json, if present.

  3. Google Application Default Credentials (ADC).

The second path respects XDG_CONFIG_HOME when set. Keep credential files outside this repository. For a service account, grant its email access to the GA4 property and point to its key:

export GOOGLE_APPLICATION_CREDENTIALS="/absolute/path/outside/repo/service-account.json"
ga4 properties

For user authentication, install the Google Cloud CLI and supply a Desktop OAuth client JSON file from your Google Cloud project:

ga4 auth --client-id-file /absolute/path/outside/repo/client_secret.json

This invokes gcloud auth application-default login with the Analytics read-only and Cloud Platform scopes. Follow the URL printed by gcloud; the browser does not launch automatically unless you add --launch-browser. Reporting requests use the analytics.readonly scope. No Analytics modification tools are exposed.

ga4 doctor checks access by listing properties. ga4 auth starts a new user authentication flow or detects the dedicated service-account file; use doctor to verify an existing ADC setup.

CLI

Use the numeric GA4 property ID, not the G-... measurement ID. Pass --property on every report to make the target explicit:

ga4 properties --format json
ga4 overview --property 123456789 --start 28daysAgo --end yesterday
ga4 pages --property 123456789 --limit 25
ga4 acquisition --property 123456789 --format csv
ga4 events --property 123456789 --format json
ga4 realtime --property 123456789 --dimensions country --metrics activeUsers,eventCount
ga4 report --property 123456789 --dimensions date,country --metrics sessions,activeUsers
ga4 metadata --property 123456789 --search session

Data commands support --format table, json, and csv. Historical reports default to 28daysAgo through yesterday. Custom reports also accept --dimension-filter-json, --metric-filter-json, and --order-by.

An explicit property takes precedence over GA4_PROPERTY_ID, followed by an optional default saved with ga4 use PROPERTY_ID. The default lives in ~/.config/ga4-cli/config.json and can be inspected with ga4 config. When --property is omitted, the CLI prints the selected property on stderr before querying it. An explicitly empty or invalid ID is rejected.

MCP

Configure an MCP client to launch ga4-mcp over stdio. Use the absolute executable path if the client does not inherit your shell's PATH:

{
  "mcpServers": {
    "google-analytics": {
      "command": "/absolute/path/to/ga4-mcp"
    }
  }
}

The server exposes eight tools:

Tool

Purpose

ga4_list_properties

Discover accessible properties

ga4_overview

Daily traffic, engagement, key events, and revenue

ga4_top_pages

Top page paths and titles

ga4_acquisition

Session channels and source/medium

ga4_events

Event counts, users, and values

ga4_run_report

Custom historical reports and filters

ga4_realtime

Realtime activity

ga4_metadata

Available dimensions and metrics

property_id is required for every report and metadata call. Omitted, null, and empty values are rejected; MCP reports do not fall back to environment variables or saved defaults. Use property discovery when the target is unknown.

Example arguments for ga4_top_pages:

{
  "property_id": "123456789",
  "start_date": "7daysAgo",
  "end_date": "yesterday",
  "limit": 25
}

MCP and CLI share authentication. The saved default property is a CLI convenience.

Report completeness

JSON and MCP reports include the target property_id, total row_count, returned_row_count, a truncated flag, and a warnings list. If the API reports more rows than returned, the report is marked truncated. The CLI also writes the warning to stderr in every output format, leaving stdout suitable for pipelines.

Increase --limit (or MCP limit) or narrow the report to retrieve more of the matching rows. The daily overview uses a fixed 366-row cap; shorten its date range or use a custom report when it is truncated. truncated: false only describes row limits; Google may still apply thresholds or sampling, reflected in metadata.

Limits

Report requests return at most 10,000 rows and do not paginate. Daily overview requests cap results at 366 rows. Historical reports require 1–9 dimensions and 1–10 metrics; realtime reports require 1–4 of each. This version accepts simple dimension and metric names; namespaced custom fields are not supported.

Metric/dimension compatibility, retention, and quotas are enforced by Google. The client uses a 60-second request timeout and does not automatically retry API failures. The CLI reports API errors on stderr and exits with status 2.

Development

uv sync --locked
uv run --locked python -m unittest discover -s tests -v
uv build

Tests use fake API responses and a local MCP handshake. They require no Google credentials and do not query Analytics.

See CONTRIBUTING.md for contribution guidelines and CHANGELOG.md for release notes. Licensed under MIT.

Available Tools

8 tools
ga4_acquisitionC

Return session channels and source/medium acquisition performance.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
end_dateNoyesterday
start_dateNo28daysAgo
property_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.6/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It says 'Return,' which implies a read-only operation, but gives no detail about pagination, date-range behavior, data granularity, or output shape. This is minimal and leaves important behavioral context undisclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

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

The description is a single, waste-free sentence that front-loads the core action and resource. It earns its place as far as it goes, though extreme brevity limits how much value the sentence provides.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters, no annotations, and only a vague description, this is not complete. The presence of an output schema reduces the need to explain return values, but the description still fails to situate the tool among siblings, clarify date range semantics, or explain property_id's role.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

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 mention property_id, start_date, end_date, or limit. It only hints at the result dimensions (session channels, source/medium), which does not compensate for the complete lack of parameter-level meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Return') and names the resource/scope ('session channels and source/medium acquisition performance'), making the tool's purpose understandable. However, it does not explicitly differentiate it from sibling tools like ga4_top_pages or ga4_events beyond the 'acquisition' framing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as ga4_realtime or ga4_overview. There are no exclusions, prerequisites, or conditions stated, leaving the agent to infer usage entirely from the tool name and minimal wording.

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

ga4_eventsC

Return top GA4 events, users, key events, and event values.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
end_dateNoyesterday
start_dateNo28daysAgo
property_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.4/5.0
Behavior2/5

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

With zero annotations, the description must carry the full behavioral disclosure burden, but it only says 'Return top...' with no mention of ordering, aggregation, date-range semantics, or caveats. No details about authentication, rate limits, or property resolution are provided.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The one-sentence description is concise and front-loaded with the core result, which is a structural strength. However, it is under-specified for a four-parameter tool with no annotations, so it is not appropriately sized overall.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, but the description still leaves key invocation details undocumented: acceptable date formats, how limit applies, what determines 'top' ranking, and how property_id is used. The agent must rely on parameter names alone, which is insufficient for reliable invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds no meaning for any of the four parameters, including the required property_id, limit, start_date, or end_date. It does not explain date formats, default semantics, or how limit affects results beyond what the schema already shows.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the GA4 events resource and says it returns top events, users, key events, and event values, which conveys a clear action and resource. It does not explicitly distinguish itself from siblings such as ga4_top_pages or ga4_run_report, so it misses the top score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given for when to use this tool rather than its siblings like ga4_overview or ga4_run_report. The description simply states what it returns, leaving the agent to infer the appropriate context.

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

ga4_list_propertiesA

List every GA4 property accessible with the current read-only credentials.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly communicates that the operation is read-only and scoped to the current credentials, and that it returns the full set of accessible properties. It does not detail pagination or ordering, but the output schema covers return structure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

The description is a single sentence with no filler. The action is front-loaded, and every word adds meaning: 'List', 'every', 'accessible', and 'current read-only credentials' all contribute to the tool's purpose and scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter listing tool with an output schema, this description is complete. It states what is returned, the scope of results, and the authentication context. Nothing needed for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema already covers 100% of the parameter space. The description's mention of 'every GA4 property accessible with the current read-only credentials' clarifies that no user-supplied parameters are needed beyond the implicit authentication context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') and a clear resource ('every GA4 property accessible'), making the tool's purpose immediately obvious. It also distinguishes itself from sibling reporting tools by indicating this is an account-level discovery operation rather than a data-reporting operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: it lists all GA4 properties under the current read-only credentials. It does not explicitly name alternatives or exclusion conditions, but among the siblings none performs the same listing function, so the intended use is evident.

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

ga4_metadataB

List compatible GA4 dimensions and metrics, optionally filtered by text.

ParametersJSON Schema
NameRequiredDescriptionDefault
searchNo
property_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure, but it only says 'List compatible GA4 dimensions and metrics.' It does not clarify what 'compatible' means (e.g., with the GA4 API, the property, or the reporting tool), nor does it mention auth requirements, rate limits, or the return shape. A read operation is implied but not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

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

The description is a single efficient sentence with no filler. The main action and optional filter are front-loaded. It earns high marks for brevity, though it sacrifices some explanatory depth.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (2 params, 1 required, output schema present), so a short description is partly forgivable. However, with 0% schema coverage and no annotations, the ambiguity of 'compatible' and the unexplained required property_id leave meaningful gaps in context for an agent deciding whether and how to call this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The phrase 'filtered by text' maps to the 'search' parameter, but the required 'property_id' parameter is not mentioned or explained. An agent must infer that property_id identifies the GA4 property for which metadata is being listed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('List') and resource ('compatible GA4 dimensions and metrics'), with an optional filter. It is clear and distinct from siblings like ga4_run_report (runs reports) and ga4_list_properties (lists properties), though it does not explicitly name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this is for discovering available dimensions/metrics, likely before constructing a report. However, it provides no explicit when-to-use guidance, exclusions, or mention of alternatives such as ga4_run_report, leaving the usage context to inference.

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

ga4_overviewC

Return daily users, sessions, engagement, key events, and revenue.

ParametersJSON Schema
NameRequiredDescriptionDefault
end_dateNoyesterday
start_dateNo28daysAgo
property_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.7/5.0
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. 'Return daily users...' indicates a read-only overview of aggregate metrics, which is some transparency, but it does not mention date handling, required property_id, or any caveats about the data returned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point. It is appropriately short for a simple overview tool, though it could have added a little more context without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has three parameters, no annotations, and only a bare output list; an output schema exists, but it does not explain how parameters control the returned data. The description lacks enough context for an agent to confidently call this tool correctly for a specific request.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

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 compensate by explaining what property_id, start_date, or end_date mean or how they affect results. It only lists output metrics, leaving parameter semantics entirely to the schema's basic type/name hints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description specifies an action ('Return') and a concrete resource: daily users, sessions, engagement, key events, and revenue. It clearly conveys what the tool produces, though it does not explicitly distinguish itself from sibling tools like ga4_report or ga4_realtime.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance about when to use this tool versus its siblings, nor any exclusions or alternatives mentioned. The description only states what it returns, so an agent must infer usage from the name and output list.

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

ga4_realtimeB

Run a GA4 realtime report for activity from the last 30 minutes.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
metricsNo
descendingNo
dimensionsNo
property_idYes
order_by_metricNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the transparency burden. It makes the read-only, time-boxed report behavior clear, but it does not disclose realtime-specific behaviors such as data latency, metric/dimension compatibility constraints, or property prerequisites. This is adequate for a simple read operation but does not go beyond the obvious.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

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

The single sentence is front-loaded and free of filler, saying exactly what the tool does in one line. It is slightly under-specified for a 6-parameter API, but the wording is appropriately concise for clarifying the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With six parameters, no annotations, and sibling tools requiring differentiation, one sentence is not enough context for reliable selection and invocation. The output schema reduces the need to explain returns, but the description still omits usage trade-offs and parameter-level guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description names none of the six parameters and adds no guidance on property_id, metrics, dimensions, ordering, or limit behavior. The schema carries all parameter meaning, so the description fails to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Run'), a specific resource ('GA4 realtime report'), and the distinctive scope of activity from the last 30 minutes. This clearly separates it from sibling tools like ga4_run_report or ga4_overview, which target different time ranges or report types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'last 30 minutes' phrasing implies this tool is for realtime queries, but the description does not explicitly state when to choose it over siblings such as ga4_run_report or ga4_acquisition. There is no when-not-to-use guidance or alternative tool mention, leaving the agent to infer usage from the name and the time window.

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

ga4_run_reportC

Run a custom historical GA4 report with requested dimensions and metrics.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
metricsYes
end_dateNoyesterday
descendingNo
dimensionsYes
start_dateNo28daysAgo
property_idYes
metric_filterNo
order_by_metricNo
dimension_filterNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries full responsibility for disclosing behavioral traits such as read-only operation, pagination, limits, or output handling. It only says 'run a report' and 'historical,' which adds temporal context but does not explain what happens when the tool is invoked or what side effects might occur.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

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

The description is a single tight sentence with the action verb front-loaded and no unnecessary filler. While it is terse, every word earns its place; the main weakness is not verbosity but lack of detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 10 parameters, 3 required, no annotations, and zero schema description coverage, this description is far from complete. It omits the required property_id and all optional parameters like filters, ordering, limit, and date range, so an agent cannot confidently construct a correct call. The output schema exists, but that does not compensate for missing invocation context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description only echoes the dimensions and metrics parameters already visible in the schema. It does not explain property_id, date defaults, limit, descending, ordering, or filters, so the agent gains no additional meaning about any of the 10 parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Run' with the resource 'custom historical GA4 report,' which clearly states what the tool does. The words 'custom' and 'historical' help distinguish it from realtime or prebuilt sibling reports like ga4_realtime or ga4_top_pages, though it does not explicitly name any sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'custom historical' implies this tool is for arbitrary dimensions/metrics over past date ranges, as opposed to realtime or preconfigured reports. However, the description does not explicitly state when to use this tool versus alternatives, leaving the agent to infer 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.

ga4_top_pagesB

Return top page paths and titles ordered by page views.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
end_dateNoyesterday
start_dateNo28daysAgo
property_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.1/5.0
Behavior3/5

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

There are no annotations, so the description bears the behavioral burden. It does signal a read-only retrieval operation and specifies ordering by page views, but it does not disclose behavior around result limits, date defaults, or required property context beyond what the schema already names.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

A single front-loaded sentence with no filler. It immediately conveys the output and ordering, which is all it attempts to communicate; the structure is as efficient as possible for the given content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations, no sibling differentiation, and no parameter guidance, the description is too thin for an agent to fully contextualize invocation. The output schema covers return shape, but selection logic and invocation expectations are underspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds no parameter meaning. It does not explain limit, date range semantics, or property_id requirements, leaving the schema's self-evident names and defaults to carry all parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb and resource: it returns top page paths and titles ordered by page views. It is distinguishable from siblings by naming a concrete report type, though it does not explicitly contrast itself with any sibling tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage: when an agent needs the most-viewed pages for a GA4 property. However, it provides no explicit guidance on when to choose this over alternatives like ga4_overview or ga4_run_report, and no exclusion criteria.

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.

  1. 8 tool updatesv0.2.0
    • First observedga4_acquisition
    • First observedga4_events
    • First observedga4_list_properties
    • First observedga4_metadata
    • First observedga4_overview
    • First observedga4_realtime
    • First observedga4_run_report
    • First observedga4_top_pages

TDQS

B3.2/5.0

Scored across 8 tools

Disambiguation4/5

Most tools are clearly distinct: one lists properties, one fetches metadata, one covers realtime data, and the rest are named report types. There is minor overlap between ga4_overview and ga4_events, which both surface users and key events, but their primary purposes remain distinguishable.

Naming Consistency3/5

All tools share the ga4_ prefix and use snake_case, but the naming convention is mixed: ga4_list_properties and ga4_run_report are verb_noun while the other six are noun-style names like ga4_overview, ga4_events, and ga4_realtime. The prefix keeps them readable, but the pattern is not fully consistent.

Tool Count5/5

With 8 tools, the server is well-scoped for a GA4 reporting assistant. Each tool has a clear role, and the count is neither bloated nor too thin.

Completeness5/5

The tool set covers listing properties, exploring compatible dimensions and metrics, realtime reporting, common pre-built reports, and a fully custom report runner. For a read-only GA4 analytics server, this provides comprehensive coverage with no obvious dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides full Google Analytics 4 management and reporting capabilities via MCP, including property management, custom dimensions, audiences, events, data streams, and real-time reporting.
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Connects 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.
    7
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables querying Google Analytics 4 properties using natural language through MCP clients. Supports customizable reports with any dimensions and metrics, listing properties, and real-time data.
    4
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables querying Google Analytics 4 data through MCP tools for running reports, listing properties, getting real-time metrics, and exploring metadata.
    13
    MIT

Latest Blog Posts

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/onionst/ga4-toolkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server