Skip to main content
Glama

Google Analytics 4 MCP by InsightfulPipe

GA4 Data Query

query_data
Read-only

Execute Google Analytics data queries (Step 3 FINAL).

Prerequisites: Run query_contexts with request='accounts' (includes available_requests) + request='actions_details' to understand the required payload.

IMPORTANT: The 'body' parameter is a dictionary that must contain ALL fields including:

  • action: Table/action name (e.g. 'runReport', 'runRealtimeReport')

  • workspace_id: Integer workspace ID

  • brand_id: Integer brand ID

  • property_id: GA4 property identifier

  • Any other fields from the helper response (filters, date ranges, dimensions, metrics, etc.)

Do NOT pass these as separate parameters - they must ALL be inside the body dictionary.

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": {
      "body": "<body>"
    },
    "name": "query_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Adds real value beyond the annotations by disclosing the non-obvious calling contract: a single opaque body dictionary that must carry all fields, plus an explicit warning not to hoist fields to top level. The readOnlyHint/openWorldHint pair is consistent with a GA4 report query, so no contradiction. It stops short of noting rate limits, payload size limits, or that queries are non-cached round-trips to Google.

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?

Front-loaded with the prerequisite before the payload detail, and the bolded warning sits where an agent will read it. Slightly padded by all-caps emphasis and a restated warning, but no sentence is truly wasted.

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?

An output schema exists, so return values needn't be explained, and the prerequisite chain plus body contract cover the main failure modes. Missing only the boundary versus execute_action and any note on how to recover when the helper response omits a field.

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

Parameters5/5

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

Schema coverage is 0% and the single parameter is a free-form object with additionalProperties=true, so the description carries the full burden — and it does. It enumerates the required keys (action, workspace_id, brand_id, property_id), gives example action values ('runReport', 'runRealtimeReport'), and points to the helper response as the source for the remaining fields.

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

Purpose4/5

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

States a specific verb and resource ('Execute Google Analytics data queries') and positions itself as the terminal step of a workflow with the '(Step 3 FINAL)' marker. It doesn't clearly differentiate itself from the sibling execute_action, which an agent could plausibly confuse with 'execute ... queries'.

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?

Explicitly names the prerequisite tool call and the exact request values needed ('query_contexts with request=accounts (includes available_requests) + request=actions_details'), which is strong sequencing guidance. It offers no exclusions or comparison to execute_action as an alternative, so the routing half is only partly covered.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.