Skip to main content
Glama

Get a YouTube Analytics report

analytics_get_youtube_report
Read-onlyIdempotent

A YouTube Analytics report for the user's own channel: views, watch time, retention, subscribers and engagement, by video, day, traffic source, country, device, audience or content type, over a date range. Numbers only the channel owner sees.

Use when: "how did my channel do last month", "which of my videos got the most watch time", "where does my YouTube traffic come from", "how much of my video do people watch", Shorts against long videos, subscribers gained by video, an audience's age, gender and country. Not for: a channel the user does not own, use youtube_get_videos and youtube_get_video for public counts. Website traffic, use analytics_get_report. Returns: List. rows[]: one object per row keyed by YouTube's names, dimensions as strings and metrics as numbers; with the video dimension each row also carries video_title. channel_id, column_types (STRING, INTEGER or FLOAT). averageViewDuration is seconds, averageViewPercentage and viewerPercentage are 0 to 100, audienceWatchRatio is a share of the starting audience. YouTube gives no row total, so meta.cursor appears whenever a page is full. Combinations YouTube accepts: top videos are dimensions ["video"] with a metric sort (at most 200 rows a page). Retention is dimensions ["elapsedVideoTimeRatio"], metrics audienceWatchRatio and relativeRetentionPerformance, and a filter on exactly one video. Traffic source detail needs a filter on one insightTrafficSourceType and at most 25 rows. Audience is ageGroup and/or gender with viewerPercentage alone. Other pairs YouTube rejects come back as InvalidTarget with its message. Cost: 0 credits. Cached 1 hour. Example: {"metrics": ["views", "estimatedMinutesWatched", "averageViewPercentage", "subscribersGained"], "dimensions": ["video"], "start_date": "2026-10-01", "end_date": "2026-10-31", "sort": {"field": "estimatedMinutesWatched"}, "limit": 10}

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "analytics_get_youtube_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNoDefault: day or month oldest first, otherwise the first metric highest first. A video breakdown must be sorted by a metric.
limitNoMax rows. Default 100, cap 1000.
cursorNoFrom meta.cursor of the previous page.
channelNoA channel_id from analytics_list_youtube_channels. Optional when one channel is connected.
filtersNoEquality filters: a row matches when the dimension equals any of its values; every filter applies. For example video, country, creatorContentType, insightTrafficSourceType.
metricsNoYouTube Analytics metric names: views, engagedViews, estimatedMinutesWatched, averageViewDuration (seconds), averageViewPercentage, subscribersGained, subscribersLost, likes, comments, shares, videosAddedToPlaylists; with elapsedVideoTimeRatio, audienceWatchRatio and relativeRetentionPerformance; with ageGroup or gender, viewerPercentage.
end_dateNoDefault three days ago; YouTube's latest days fill in late.
dimensionsNoYouTube Analytics dimension names: day, month, video, country, deviceType, operatingSystem, insightTrafficSourceType, insightTrafficSourceDetail, subscribedStatus, creatorContentType (SHORTS, VIDEO_ON_DEMAND, LIVE_STREAM), ageGroup, gender, elapsedVideoTimeRatio (retention, with one video filter). None gives one total row.
start_dateNoDefault 27 days before end_date.

Output Schema

NameRequiredDescriptionDefault
metaYes
rowsNo
errorNo
hintsYes
channel_idNo
column_typesNoEach column's type as YouTube gives it: STRING, INTEGER or FLOAT.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is covered upstream. The description still adds real context beyond that: cost of 0 credits, a 1-hour cache, the fact that YouTube provides no row total so meta.cursor appears on full pages, and that invalid dimension/metric pairs surface as InvalidTarget. It stops short of describing auth requirements or what happens when no channel is connected beyond the schema's hint.

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?

Long but organized and front-loaded: purpose, then Use when / Not for, then Returns, then accepted combinations, then cost and a worked example. Nearly every sentence carries actionable information, though the units for averageViewDuration and viewerPercentage appear both in the description and the schema, a minor redundancy.

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 9-parameter tool with nested objects and an output schema, this covers what an agent needs: default behaviors, the row/cursor pagination model, per-dimension unit semantics, valid combination constraints, error behavior, cost and caching. Return-value explanation is partly duplicated by the output schema but the description adds the semantics the schema would not convey.

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 is 3; the description earns above that by documenting valid combinations the schema cannot express — top videos need dimensions ['video'] with a metric sort and at most 200 rows, retention requires elapsedVideoTimeRatio with audienceWatchRatio/relativeRetentionPerformance plus a single-video filter, traffic-source detail needs one insightTrafficSourceType and 25 rows. It also pins units (averageViewDuration in seconds, percentages 0–100, audienceWatchRatio as a share of starting audience) that clarify metric meaning rather than restating the schema.

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?

States a specific verb and resource ('A YouTube Analytics report for the user's own channel') and immediately enumerates what it covers (views, watch time, retention, subscribers, engagement) and the breakdown dimensions. It explicitly scopes to the owner's channel — 'Numbers only the channel owner sees' — which separates it from the public-data siblings youtube_get_videos and youtube_get_video named later.

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

Usage Guidelines5/5

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

Provides an explicit 'Use when' block with concrete user phrasings ('how did my channel do last month', 'where does my YouTube traffic come from') and a 'Not for' block that routes non-owned channels to youtube_get_videos/youtube_get_video and website traffic to analytics_get_report. Both the positive trigger and the exclusion conditions are stated, leaving little inference.

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.

Resources