Skip to main content
Glama
luminarylane

GA4 MCP Server

by luminarylane

ga4_get_traffic_sources

Analyze Google Analytics 4 traffic sources by source/medium, returning sessions, users, bounce rate, and conversions per source to identify top-performing channels.

Instructions

Get traffic sources breakdown by source/medium. Shows sessions, users, bounce rate, and conversions per traffic source.

Args: property_id: GA4 property ID (numeric). Leave empty to use GA4_PROPERTY_ID env var. days: Lookback period in days (default: 28). row_limit: Max rows to return (default: 20).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo
row_limitNo
property_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries full burden. It indicates a 'get' operation, implying read-only, but does not disclose potential behavioral traits such as sorting order, pagination, rate limits, or data freshness. The env var fallback for property_id is a useful detail, but otherwise the behavior is only partially transparent.

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 extremely concise, starting with the main purpose in one sentence, then listing parameters in a clear arg block. Every sentence earns its place with no 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?

Given the presence of an output schema, the description need not explain return values. It covers the core functionality, metrics, and parameters adequately for a straightforward retrieval tool. However, it lacks explicit guidance on usage context or alternatives, which would make it more complete.

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 input schema has 0% description coverage, so the description adds essential meaning for all three parameters. It explains that property_id can use an env var default, days is a lookback period, and row_limit caps results. This goes beyond the schema but could provide more detail on value ranges or formats.

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 clearly states it retrieves traffic sources breakdown by source/medium and lists the specific metrics (sessions, users, bounce rate, conversions). This specific verb+resource combination distinguishes it from sibling tools like ga4_get_top_pages and ga4_get_conversions.

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 use for traffic source analysis but does not explicitly mention when to choose this over alternatives. No exclusions or alternative tool names are given, leaving the agent to infer from the name and sibling context.

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

Install Server

Other Tools

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/luminarylane/ga4-mcp'

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