Skip to main content
Glama

Get Analytics

get_analytics
Read-onlyIdempotent

Retrieve YouTube channel analytics totals or rows broken down by day, video, country, device, and more for a chosen date range.

Instructions

YouTube Analytics for your channel: totals, or rows broken down by one dimension.

Data for the last two or three days is incomplete, so recent rows keep growing. Uses the separate YouTube Analytics API and its quota; enable it in the same Google Cloud project.

Quota: no YouTube Data API units.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNoBreak the numbers down by this dimension; its column is named as given here. Omit for totals. By month, the range widens to whole months.
sortNoMetric or dimension to sort by; prefix with - for descending, e.g. -views. Defaults to chronological by day or month, and to the first metric, descending, by anything else.
limitNoMaximum number of rows. Breaking down by video returns at most 200, 25 by default; other breakdowns return every row by default.
sinceNoFirst day, inclusive: 2026-01-01, or 90d / 4w before until. Defaults to 28 days before until.
untilNoLast day, inclusive: 2026-01-31, or 7d / 1w ago. Defaults to today.
videosNoOnly these videos (IDs or URLs).
metricsNoMetric names from https://developers.google.com/youtube/analytics/metrics, e.g. views, estimatedMinutesWatched, subscribersGained. Defaults to views, watch time, average view duration, likes, comments, and subscribers gained and lost. By device, os, traffic-source, playback-location or subscribed, only watch metrics work (views, estimatedMinutesWatched, averageViewDuration, averageViewPercentage), and those are the default. By age or gender, only viewerPercentage works.
my_channelNoWhich of your logged-in channels to work on: UC… ID, @handle or exact title. Omit for the default channel.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes
sinceYes
untilYes
columnsYesDimension first (if any), then the metrics, in request order.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so safety is covered. The description adds genuinely non-obvious behavior: recent data is incomplete and keeps growing, and the call draws on a separate quota that consumes zero YouTube Data API units — a cost signal an agent planning a multi-call workflow actually needs.

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 capability statement is front-loaded in one line, followed by two short paragraphs that each carry a distinct operational fact (data latency, separate API/quota). No sentence repeats the name, the annotations, or the schema.

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?

With an output schema present and all eight parameters fully documented in the schema, the description only needs to carry setup and freshness context, which it does. A brief note on how to combine dimensions and metrics would round it out, but nothing an agent needs to invoke it correctly is missing.

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

Parameters3/5

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

Schema coverage is 100% and each parameter carries a rich description (dimension naming, sort prefixes, 200-row cap for video breakdowns, relative date syntax, metric compatibility per dimension), so the schema does all the work. The tool description itself contributes no parameter-level information, which is the baseline-3 case.

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 first sentence names the exact resource and the two output shapes it can produce: aggregate totals versus rows broken down by a single dimension. That is specific enough to distinguish it from every sibling in the list, none of which touch analytics. It stops short of a 5 only because it never explicitly contrasts itself with the closest data-reading siblings like get_videos or get_channel.

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?

It gives real prerequisites — the separate YouTube Analytics API must be enabled in the same Google Cloud project — and a caveat about when the data is trustworthy (the last two to three days keep growing). What's missing is explicit routing: nothing says to use get_channel or get_videos for non-analytics channel/video metadata instead.

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