Skip to main content
Glama

Run a Google Analytics report

analytics_report
Read-only

Retrieve GA4 dimensions and metrics, sorted highest first, to analyze traffic, engagement, and revenue without changing data.

Instructions

Any GA4 report: dimensions and metrics by their GA4 API names, highest first. Common dimensions: date, landingPage, pagePath, sessionDefaultChannelGroup, sessionSourceMedium, sessionCampaignName, sessionGoogleAdsCampaignName, deviceCategory, country, eventName. Common metrics: sessions, totalUsers, engagedSessions, engagementRate, keyEvents, sessionKeyEventRate, screenPageViews, ecommercePurchases, purchaseRevenue. For Google search queries, clicks and positions use search_console_performance: GA4's organicGoogleSearch* fields need Search Console linked in GA4 and combine with few dimensions. Changes nothing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "property_id": "<property_id>",
      "metrics": "<metrics>"
    },
    "name": "analytics_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoLook-back window in days, ending yesterday
limitNoMost rows to return
filterNoOnly rows whose dimension contains this text (case-insensitive)
metricsYesGA4 metric names
end_dateNoExact last day, YYYY-MM-DD
order_byNoA requested metric (highest first) or dimension (A to Z, dates oldest first); defaults to the first metric
dimensionsNoGA4 dimension names; none gives totals
start_dateNoExact first day, YYYY-MM-DD
property_idYesGA4 property id, digits only (from analytics_properties)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.46.0
    • changedInput schema / properties / start_date / description
      Previous value: -"Exact first day, YYYY-MM-DD. Pass with end_date to use exact dates instead of days"New value: +"Exact first day, YYYY-MM-DD"
  2. Changed1 schema field changedv0.19.0
    • changedInput schema / properties / order_by / description
      Previous value: -"Metric to sort by, highest first; defaults to the first metric"New value: +"A requested metric (highest first) or dimension (A to Z, dates oldest first); defaults to the first metric"
  3. Addedv0.15.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint and destructiveHint=false, and the description reinforces with 'Changes nothing' while disclosing a genuine data-availability caveat (organicGoogleSearch* requires GA4–Search Console linking and limited dimension combinations). It does not cover failure modes for invalid dimension/metric names or row-cap behavior, so it stops short of full transparency.

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?

Front-loaded purpose, then compact dimension/metric vocabularies, then the sibling routing rule, then the read-only note, all in a few dense sentences. The enumerations are long but each item is a usable valid value rather than filler.

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

Completeness4/5

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

For a 9-parameter tool with a nested filter object, no output schema and full schema coverage, the description supplies the missing piece an agent needs most — the valid dimension/metric vocabulary and the ordering default — plus the search-console routing caveat. Only error behavior and result-cap semantics are left to the schema.

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?

Schema coverage is 100%, so the baseline would be 3, but the description adds real meaning by enumerating accepted dimension names (date, landingPage, pagePath, sessionDefaultChannelGroup, ...) and metric names (sessions, engagedSessions, keyEvents, purchaseRevenue, ...), which the schema only labels generically as 'GA4 metric names'. That vocabulary directly reduces invalid-input errors, though it is explicitly 'common' rather than exhaustive.

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?

Opens with a specific verb and resource ('Any GA4 report: dimensions and metrics by their GA4 API names'), states the default ordering ('highest first'), and explicitly separates itself from search_console_performance for Google search query data. An agent can identify the tool and its scope without opening the schema.

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

Usage Guidelines4/5

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

Gives an explicit routing rule with a reason: use search_console_performance for Google search queries because GA4's organicGoogleSearch* fields require Search Console to be linked and only work with few dimensions. That is clear when-to-use guidance for the main ambiguity. It does not state exclusions for other analytics siblings, but no false alternatives are implied.

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