yt-analytics-mcp
Provides owner-side YouTube analytics, including watch time, traffic sources, audience retention, playlist performance, and episode comparison for the authenticated user's channel.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@yt-analytics-mcpHow is my newest episode doing against the previous one?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
yt-analytics-mcp
Owner-side YouTube analytics for AI agents: watch time, traffic sources, audience retention, playlist and podcast-series metrics, and episode-over-episode comparison. Read-only, all of it.
An MCP server for the YouTube Analytics API v2. It gives an AI assistant the numbers only a channel owner can see — the ones behind the public view count. How long people actually watched, where they came from, where in a video they left, which playlist they were working through, and how a new episode is tracking against the last five at the same age.
Why this exists. Google ships official MCP servers for Workspace, Google Analytics, and BigQuery. It does not ship one for YouTube Analytics, and the community servers that claim to cover it are mostly wrapping the public Data API — which can tell you a video's view count and nothing about watch time, retention, or traffic sources, because that data is owner-only and needs OAuth. This server does the owner-side half properly and stops there.
It was built to run analytics for a podcast, which is why the playlist tooling is unusually complete. Nothing here is specific to that show; point it at any channel you own.
Tools
Nine tools. Every one is a read.
Tool | What it returns | API |
| Which channel the credential owns, with subscriber/view/video counts |
|
| Views, watch time, avg duration/percentage, subs gained/lost, likes, comments, shares — as a total or a day/month series |
|
| Views and watch time by how viewers arrived (search, suggested, external, Shorts feed, subscriptions, playlists…) |
|
| Videos ranked by any core metric, with titles |
|
| Metrics for videos you name, and which of them had no activity |
|
| The drop-off curve for one video, ~100 points sampled down |
|
| Views and watch time by country, with each country's share |
|
| Playlist starts, views per start, time in playlist, saves — the podcast-series view |
|
| Derived. Several videos re-indexed to days-since-their-own-publish, plus a leaderboard at the oldest age they all share |
|
Side effects: there are none
Every tool is readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true. All four hints are stated explicitly on all nine tools rather than left to defaults, because MCP's destructiveHint defaults to true — an omitted hint tells a client to raise a delete-grade consent prompt for reading a view count.
That is not just a labelling convention. The HTTP client in src/client.ts has no write path: every method is a GET, and ids=channel==MINE is hardcoded rather than accepted from any tool input, so no argument an agent can pass will point this server at another channel or change anything on yours. The e2e test asserts the exact annotation object on each tool from a real tools/list, and includes a control proving that assertion can go red.
The derived view
yt_episode_race is the one tool that computes rather than reports, and it exists because raw totals cannot answer the only question that matters week to week: is this episode doing better than the last one? An episode published a month ago has simply had more days to accumulate views. Re-indexing each video to days since its own publish date removes that, so day 7 sits next to day 7.
Two details it gets right that a naive version would not: each curve is truncated at the video's real age rather than padded with its last value (padding makes a 3-day-old episode look like it flatlined for 25 days), and the leaderboard is pinned to the oldest day every video has reached, never to lifetime totals. Every response labels exactly which fields the server computed (computedFields) and returns the API's own per-day values alongside them.
Related MCP server: youtube-organic-mcp
Authentication
An OAuth installed-app credential — a saved refresh token — not a service account and not an API key. There is no API-key path to this data: watch time, retention, and traffic sources are owner-only, and Google will not serve them to anything but an OAuth token for an account that owns the channel.
Default location, shared on purpose with the sibling servers and any Google scripts you already run:
~/.config/gws/youtube_credentials.jsonSet YT_ANALYTICS_CREDENTIALS_PATH to use a different file.
Scopes
Scope | Needed for |
| Required. Every Analytics report. |
| Optional. Video titles, channel metadata, and publish dates — so |
yt-analytics-monetary.readonly is accepted in place of the first; youtube and youtube.force-ssl are accepted in place of the second. Without the optional scope the server still starts and every Analytics tool still works — you get bare video IDs and a note explaining why, not a failure.
Minting the credential
In Google Cloud Console, create an OAuth client of type Desktop app and download its
client_secret.json.Enable both the YouTube Analytics API and the YouTube Data API v3 on that project.
Set the OAuth consent screen's publishing status to "In production" — click Publish app. See the warning below; this is the step everyone skips.
Run any standard
google-auth-oauthlibinstalled-app flow requesting the scopes above and save the result to the path above. About ten lines of Python, one browser consent click.
⚠️ Publish the app, or your token dies in 7 days
Google's OAuth documentation: "A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of 'Testing' is issued a refresh token expiring in 7 days, unless the only OAuth scopes requested are a subset of name, email address, and user profile."
These scopes are not that subset. Leave the project in Testing and this server will work for a week and then start failing with an auth error that looks like a bug in the server. Switch the consent screen to In production and refresh tokens stop expiring.
You do not need Google to verify your app for this.
yt-analytics.readonlyandyoutube.readonlyare sensitive, not restricted, and an app using its own OAuth client for its own owner's data does not go through verification review — an unverified-app warning at the consent screen is expected, and you click through it. Do not use a shared or hosted OAuth client to dodge this: those hit a 100-new-user cap that cannot be reset.
Starting without a credential
The server boots and answers tools/list with no credential at all, so MCP inspectors can introspect it. Tool calls then return a setup pointer. Diagnostics go to stderr; stdout is the MCP transport and stays clean JSON-RPC.
Setup
Add to your MCP client config — .mcp.json for Claude Code, claude_desktop_config.json for Claude Desktop:
{
"mcpServers": {
"yt-analytics": {
"command": "node",
"args": ["/path/to/yt-analytics-mcp/dist/index.js"]
}
}
}No env block is needed when the credential is at the default path.
Then ask your assistant: "Which YouTube channel am I connected to?", then "Show me traffic sources for the last 30 days," then "Race my last three episodes against each other."
Limitations
Read these. Several of them are things competing servers claim to do and cannot.
No impressions, no impressions CTR, no unique viewers. These exist in YouTube Studio and do not exist in the Analytics API. Each returns
Unknown identifier (...) given in field parameters.metrics— verified live, not inferred from docs. Any MCP server advertising click-through rate from this API is advertising something it cannot deliver. If you need CTR, the Studio UI is the only source.Data lags 2–3 days. End your ranges a few days before today or the last days come back as zeros.
yt_episode_racedefaults its as-of date to yesterday for this reason; passas_of_dateexplicitly if you want a reproducible answer.Owner-side only. This reads
channel==MINEand nothing else. You cannot point it at a competitor's channel — not a limitation of this server, a limitation of the API, and the correct one.Retention needs volume. YouTube withholds the retention report for videos below a watch-time threshold.
yt_audience_retentionsays so rather than returning a bare empty array.One video per retention call, enforced here. The API accepts a comma-separated list on the retention report and then silently returns only the first video's curve with HTTP 200 — verified live with two real owned video IDs. Google's docs say single-ID-only; the API does not enforce it. This server rejects lists so you never get one episode's numbers labelled as several.
Report-specific caps you will hit. Video-ranked reports cap at 200 rows and require a sort order (no sort is an HTTP 400). Month grouping requires the range to sit on whole-month boundaries. The server sends the sort automatically and checks month alignment before the request, so you should not meet these — but they are why some parameter combinations are not offered.
reports.queryonly; no Reporting API. The bulk YouTube Reporting API is a different shape: "You can start retrieving the report within 48 hours of the time that the job is created," and "API reports are available for 60 days from the time that they are generated." A two-day cold start and a rolling 60-day window is a batch-warehouse contract, wrong for an interactive agent. Deliberately out of scope; use the BigQuery path below if you want bulk history.No caching, no stored history. Every call goes to Google. That is a deliberate simplification, not an oversight — see below.
API terms and data handling
Worth stating plainly, since an agent reading your analytics is exactly the case these rules were written for.
Storage. This server stores nothing. No cache, no database, no history file; responses go to the caller and are gone. YouTube's Developer Policies (§III.E.4.b) do permit storing Analytics API data long-term, so a future caching layer would not be prohibited — but the 30-day cap in §III.E.4.c/d applies to other data classes, and holding nothing keeps the question from arising.
Derived metrics. §III.E.4.h prohibits replacing API Data with independently calculated substitutes or using it to create new metrics. This server computes only plain arithmetic over YouTube's own numbers — running sums, a part-of-total share, a day difference — never a score, index, or composite rating. Every response that contains a computed value lists those fields under computedFields and returns the API's own values beside them, so nothing this server calculated can be mistaken for something YouTube reported. If you extend it, keep that line.
Other options
Nothing else fills this slot well, which is why this exists — but be precise about what the alternatives are.
You want | Use |
Owner-side YouTube Analytics via MCP | this repo — no official Google server exists for it |
YouTube public data (search, metadata, comments, uploads) | a Data-API server such as ZubeidHendricks/youtube-mcp-server — popular, but Data-API-centric; an API key can never reach owner-only metrics |
YouTube analytics in a warehouse, with SQL | BigQuery Data Transfer's YouTube Channel connector plus Google's own BigQuery MCP — a genuinely good path if you already run BigQuery, at the cost of warehouse setup and transfer latency |
The analytics siblings
Data | Server |
YouTube Analytics | this repo |
Google Workspace | |
Search Console | gsc-mcp — same curated approach, including derived views like |
Google Analytics 4 | googleanalytics/google-analytics-mcp — Google's own, read-only |
BigQuery | googleapis/mcp-toolbox — Google's own |
These are separate credential families, not one login. Workspace authenticates with gws auth login, Search Console with a webmasters OAuth credential, GA4 with Application Default Credentials scoped analytics.readonly, and this one with a yt-analytics.readonly OAuth credential. Nothing here shares a token with anything else.
Development
npm install
npm run build
npm testTests mock the HTTP layer and make no network calls. Assertions pin exact values — the request parameters built for each tool, the exact annotation object on each tool from a real tools/list — rather than shapes, and carve-outs carry a must-fail leg beside the must-pass one.
A separate live smoke test drives every tool against the real API with your real credential. It is not part of npm test:
node scripts/smoke.mjsContributing
Issues and pull requests welcome. If a YouTube Analytics report is worth wrapping, open an issue describing what it should return and the dimension/metric combination it maps to — and please verify that combination against the live API first, because the docs and the API disagree in places (the retention filter being the sharpest example). Keep the contract honest: every tool stays read-only, annotations stay explicit, computed fields stay labelled, and responses stay compact.
About
Built and maintained by Conor Bronsdon. I host the Chain of Thought podcast, which covers AI infrastructure, developer tools, and how practitioners actually use this stuff. I built this to pull YouTube's owner-side numbers into the agent workflows that run the show.
Companion tools:
gsc-mcp: Search Console — search performance, striking-distance keywords, sitemaps, URL inspection.
gws-mcp-server: Google Workspace — Gmail, Calendar, Drive, Sheets, Docs, Tasks.
op3-mcp: podcast analytics through OP3 — downloads, geography, apps, per-episode breakdowns.
Transistor-MCP: the Transistor.fm MCP server — episodes, transcripts, download counts.
ai-tools-for-creators: a curated list of AI skills and MCP servers for people who ship ideas for a living.
More at conorbronsdon.com, chainofthought.show, GitHub, X, and LinkedIn.
Disclaimer
This is an independent personal project, not affiliated with, sponsored by, or endorsed by Google LLC or YouTube. All views expressed are my own.
License
MIT
Available Tools
9 toolsyt_audience_retentionAudience retention curve for one videoARead-onlyIdempotent
The retention curve for a single video: at each 1% slice of its runtime, what fraction of viewers were still watching (audienceWatchRatio) and how that compares with similar YouTube videos of similar length (relativeRetentionPerformance, 0-1 where 0.5 is median). This is where you find the drop-off — the intro that loses people, the mid-roll dip. Exactly one video ID: the API accepts a list but silently reports only the first, so this tool rejects lists rather than mislabel the result.
| Name | Required | Description | Default |
|---|---|---|---|
| metrics | No | Retention metrics to return. | |
| end_date | Yes | End date, YYYY-MM-DD, inclusive. YouTube Analytics lags roughly 2-3 days, so ending the range at today usually returns zeros for the last few days. | |
| video_id | Yes | A single YouTube video ID. Lists are rejected — call once per video. | |
| start_date | Yes | Start date, YYYY-MM-DD, inclusive. Interpreted in the channel's timezone. | |
| sample_every | No | Return every Nth point of the curve to keep the response small. The API returns ~100 points (one per 1% of runtime); the default of 5 gives ~20. Pass 1 for the full curve. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnly and idempotent hints in annotations, the description discloses a critical behavior: the underlying API silently accepts lists but the tool rejects them to avoid mislabeling. It also explains the interpretation of relativeRetentionPerformance (0-1, 0.5 median), which is valuable context that goes beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loading the core purpose in the first sentence and adding critical usage constraints in the second. No unnecessary words, and each sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description compensates by outlining the data granularity (1% slices) and the two metrics. It also explains the list-rejection behavior. This is sufficient for a read-only tool with comprehensive annotations and schema descriptions, though it stops short of fully describing the response structure.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already documents all 5 parameters with descriptions, so the baseline is 3. The description adds meaning by explaining the 1% slice granularity and the semantics of relativeRetentionPerformance, which enriches understanding of the metrics parameter and the tool's output.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states 'The retention curve for a single video' and defines each metric (audienceWatchRatio and relativeRetentionPerformance), making the tool's purpose unambiguous and distinct from sibling analytics tools. It clearly specifies the resource (a single video) and the action (retrieving retention curve data).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides clear usage guidance: use this tool to find drop-off points, and explicitly warns that lists are rejected, so call once per video. However, it does not name alternative sibling tools for comparison, so it falls short of full 5-level guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yt_channel_infoIdentify the channel behind the credentialARead-onlyIdempotent
Show which YouTube channel this server's OAuth credential owns, with its public subscriber, view, and video counts. This is the entry point: every other tool reports on this channel and only this channel, so start here to confirm you are looking at the right account. Costs 1 YouTube Data API quota unit and needs the youtube.readonly scope; with only the analytics scope it reports the scopes it has instead.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description goes well beyond the annotations by revealing a quota cost ('Costs 1 YouTube Data API quota unit'), a required scope ('needs the youtube.readonly scope'), and a conditional fallback behavior ('with only the analytics scope it reports the scopes it has instead'). These are important non-obvious traits that help an agent predict side effects and edge cases. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is exactly two sentences. The first sentence front-loads the core purpose and output, while the second adds crucial context (entry point, quota, scope, fallback). Every clause earns its place; there is no fluff or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 params, no output schema), the description is complete: it explains the channel it targets, its role among siblings, expected return values (counts or scopes), and caveats (quota, scope requirements). The agent can confidently select and invoke this tool without additional documentation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the description has no parameter semantics to clarify. Per the rubric, a 0-parameter tool gets a baseline of 4. The description adds no parameter-specific information, but none is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Show which YouTube channel this server's OAuth credential owns, with its public subscriber, view, and video counts.' It uses a specific verb (Show) and resource (channel), and explicitly lists the output counts. It also distinguishes itself from siblings by noting 'every other tool reports on this channel and only this channel,' making its unique role as the channel-identifying entry point unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides strong when-to-use guidance: 'This is the entry point' and 'start here to confirm you are looking at the right account.' It implies alternatives (the other tools that report on this channel) but does not explicitly state when not to use the tool or name specific alternatives for different purposes. The context is clear enough for an agent to know this is the first tool to call.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yt_channel_overviewChannel performance over a date rangeARead-onlyIdempotent
Owner-side channel totals for a date range: views, watch time, average view duration and percentage, subscribers gained and lost, likes, comments, and shares. Pass group_by='day' or 'month' for a time series instead of a single total row. This is the 'how is the channel doing' tool — start with it, then drill into traffic sources or individual videos.
| Name | Required | Description | Default |
|---|---|---|---|
| metrics | No | Which metrics to return. Fewer metrics, smaller response. | |
| end_date | Yes | End date, YYYY-MM-DD, inclusive. YouTube Analytics lags roughly 2-3 days, so ending the range at today usually returns zeros for the last few days. | |
| group_by | No | 'none' returns one summary row for the whole range. 'day' or 'month' returns a time series — a 90-day range at 'day' is 90 rows, so keep ranges short or use 'month'. 'month' requires start_date to be the 1st of a month and end_date to be a month's last day. | none |
| start_date | Yes | Start date, YYYY-MM-DD, inclusive. Interpreted in the channel's timezone. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint. The description adds behavioral context beyond that, such as the YouTube Analytics 2-3 day lag on end_date and the row-count implications of group_by='day' or 'month' for long ranges. However, it doesn't describe the response structure or any edge cases like null metrics, which would be expected without an output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences: the first lists the metrics, the second explains grouping, the third gives tool positioning. Every sentence serves a distinct purpose with no filler, front-loading the core function first.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite the lack of an output schema, the description covers the core functionality, the main grouping option, and guidance on when to choose this tool over siblings. It omits details like exact response field names or pagination, but for an overview tool with strong annotations and schema, this is a reasonable level of completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with each parameter already having meaningful descriptions. The description's mention of group_by='day' or 'month' for a time series is essentially redundant with the schema. It adds no new semantic info beyond what the schema provides, so a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description uses a specific verb ('totals') and resource ('channel') with a clear scope ('over a date range'). It lists the metrics returned and explicitly distinguishes itself from traffic source and video-level tools, making it easy to differentiate from siblings like yt_traffic_sources and yt_top_videos.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use it: 'This is the how is the channel doing tool — start with it, then drill into traffic sources or individual videos.' This gives clear usage context and names alternatives, satisfying the when-to-use vs alternatives guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yt_episode_raceEpisode-over-episode race, normalised by ageARead-onlyIdempotent
The derived view: compare several videos on equal terms by re-indexing each one's daily numbers to days since its own publish date, so day 7 of a new episode sits next to day 7 of the last five. Raw totals cannot answer 'is this episode outperforming?' because an older video has simply had more days to accumulate; this removes that. Returns each video's cumulative curve by age plus a leaderboard at the oldest day all of them have reached, with each video's raw per-day API values returned alongside the running totals. Costs 1 YouTube Data API quota unit for publish dates (required — the normalisation is impossible without them) plus one Analytics query per video.
| Name | Required | Description | Default |
|---|---|---|---|
| metric | No | Which metric to race on. | views |
| video_ids | Yes | Two to ten video IDs to compare. Get them from yt_top_videos, or use your last N episode IDs. | |
| as_of_date | No | Treat this date as 'today', YYYY-MM-DD. Defaults to yesterday (UTC), since YouTube Analytics lags. Pass it explicitly for a reproducible comparison. | |
| window_days | No | How many days after publish to track, 1-90. Each video's curve is truncated at its actual age — a 3-day-old video returns 4 points, not 28 padded ones. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnlyHint and idempotentHint annotations, the description discloses quota costs ('Costs 1 YouTube Data API quota unit for publish dates... plus one Analytics query per video') and the exact output structure ('cumulative curve... leaderboard... raw per-day API values'). This is rich behavioral context not present in annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four sentences, each serving a distinct purpose: purpose, motivation, output, and cost. No filler or repetition of schema fields.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only comparison tool, the description covers the core value proposition, the output content, and resource costs. Without an output schema, the return description suffices to set expectations. The missing elements (e.g., exact leaderboard computation) are minor.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides 100% description coverage for all four parameters, including detailed semantics for window_days and metric. The tool description adds conceptual framing (normalization by age) but not additional per-parameter syntax, so it neither supplements nor conflicts with the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'The derived view: compare several videos on equal terms' immediately stating the tool's function. It specifies the mechanism (re-indexing to days since publish) and distinguishes from raw totals, making it clearly distinct from sibling performance tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly frames the use case with 'Raw totals cannot answer "is this episode outperforming?" because an older video has simply had more days to accumulate; this removes that.' This tells the agent when to use the tool (fair episode comparison) and when not (raw totals), though it does not name a specific sibling tool as an alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yt_geographyViews by countryARead-onlyIdempotent
Break views and watch time down by viewer country, ranked. Countries come back as ISO 3166-1 alpha-2 codes (US, GB, IN). Optionally scope to a single video. Useful for deciding where an audience actually is before making scheduling, language, or sponsorship calls.
| Name | Required | Description | Default |
|---|---|---|---|
| metrics | No | Metrics to return per country. | |
| end_date | Yes | End date, YYYY-MM-DD, inclusive. YouTube Analytics lags roughly 2-3 days, so ending the range at today usually returns zeros for the last few days. | |
| video_id | No | Optional: restrict to one video instead of the whole channel. | |
| start_date | Yes | Start date, YYYY-MM-DD, inclusive. Interpreted in the channel's timezone. | |
| max_results | No | How many countries to return, ranked by views. 1-200. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, openWorldHint=true, idempotentHint=true, destructiveHint=false. The description adds context beyond annotations: countries are returned as ISO codes, results are ranked, and it can be scoped to a single video. No contradiction with annotations. It does not mention pagination, but annotations cover the safety profile.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, front-loaded with the primary action, and contains no redundant or filler wording. It efficiently conveys purpose, output format, optional scoping, and use case.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the rich schema (100% coverage), comprehensive annotations, and absence of output schema, the description is complete enough. It covers the tool's purpose, output format (ISO codes), ranked results, optional video scoping, and a practical use case. No critical information is missing for an agent to select and invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description adds minimal parameter context—'Optionally scope to a single video' paraphrases video_id, and 'ranked' relates to max_results—but does not significantly expand on the schema's detailed parameter descriptions. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it 'break[s] views and watch time down by viewer country, ranked.' It specifies the resource (geographic breakdown) and action, and mentions output format (ISO 3166-1 alpha-2). This distinguishes it from sibling tools like yt_traffic_sources or yt_top_videos by focusing on country-level data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a concrete use case: 'Useful for deciding where an audience actually is before making scheduling, language, or sponsorship calls.' It implies when to use this tool but does not explicitly name alternatives or state when not to use it. Clear context, but no exclusions mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yt_playlist_performancePlaylist and podcast-series performanceARead-onlyIdempotent
How your playlists perform as playlists, not just as bags of videos. A YouTube podcast IS a playlist, so this is the series-level view: playlistStarts (how often someone began the series), viewsPerPlaylistStart (how many episodes they watched before leaving — the binge metric), averageTimeInPlaylist in seconds, playlistSaves, and playlist-scoped views and watch time. Group by 'playlist' to rank series, 'day' for a trend, or 'none' for a channel-wide total. Ranking by playlist requires a sort order, which this tool always sends.
| Name | Required | Description | Default |
|---|---|---|---|
| metrics | No | Playlist metrics to return. subscribersGained and other channel metrics are not valid on playlist reports and are not offered here. | |
| sort_by | No | Metric to rank playlists by, highest first. Ignored when group_by='day'. | playlistViews |
| end_date | Yes | End date, YYYY-MM-DD, inclusive. YouTube Analytics lags roughly 2-3 days, so ending the range at today usually returns zeros for the last few days. | |
| group_by | No | 'playlist' returns one row per playlist, ranked. 'day' returns a trend across all playlists. 'none' returns a single channel-wide total. | playlist |
| start_date | Yes | Start date, YYYY-MM-DD, inclusive. Interpreted in the channel's timezone. | |
| max_results | No | How many playlists to return when group_by='playlist'. 1-200. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true, but the description adds substantial behavioral context: it explains what each metric means (e.g., viewsPerPlaylistStart as the 'binge metric'), how grouping changes the output, and that the tool automatically sends a sort order when ranking by playlist. This goes well beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the core purpose, followed by a list of key metrics and grouping guidance. Every sentence contributes meaning without redundancy or fluff, making it efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (6 parameters, no output schema), the description covers the purpose, key metrics, grouping modes, and sort behavior sufficiently. It doesn't explicitly describe the response row format, but the schema's group_by descriptions handle that, and the description provides enough context for an agent to select and invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema descriptions cover all parameters (100% coverage), so the baseline is 3. The description adds value by semantically interpreting the metrics (e.g., playlistStarts as 'began the series') and clarifying the effect of group_by values, which enriches understanding beyond the schema's enum descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reports playlist performance as a series-level view, with specific metrics like playlistStarts and viewsPerPlaylistStart. It distinguishes itself from video-level tools by saying 'not just as bags of videos' and explicitly framing podcasts as playlists, making the resource and action unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains the grouping options ('playlist', 'day', 'none') and the sort-order requirement, giving clear context on how to use the tool. However, it does not explicitly name alternative sibling tools or state when not to use it, though the 'not just as bags of videos' contrast hints at when video-level tools are more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yt_top_videosTop videos by a metricARead-onlyIdempotent
Rank the channel's videos over a date range by views, watch time, average view duration, or subscribers gained. Use this to find which videos to look at more closely — the IDs it returns feed yt_audience_retention, yt_traffic_sources, and yt_episode_race. max_results is capped at 200 by the API. Setting resolve_titles=true spends 1 YouTube Data API quota unit per 50 videos (default daily budget: 10,000 units); the Analytics query itself does not draw on that budget. Pass resolve_titles=false to return bare video IDs and spend none.
| Name | Required | Description | Default |
|---|---|---|---|
| metrics | No | Metrics to return per video. | |
| sort_by | No | Metric to rank by, highest first. | views |
| end_date | Yes | End date, YYYY-MM-DD, inclusive. YouTube Analytics lags roughly 2-3 days, so ending the range at today usually returns zeros for the last few days. | |
| start_date | Yes | Start date, YYYY-MM-DD, inclusive. Interpreted in the channel's timezone. | |
| max_results | No | How many videos to return, 1-200. Keep it low; rows cost tokens. | |
| resolve_titles | No | Look up each video's title so the result is readable. Setting resolve_titles=true spends 1 YouTube Data API quota unit per 50 videos (default daily budget: 10,000 units); the Analytics query itself does not draw on that budget. Pass resolve_titles=false to return bare video IDs and spend none. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and non-destructive. The description adds concrete behavioral details: max_results cap, resolve_titles quota cost per 50 videos, no quota for analytics query, and behavior when false. This goes beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with purpose and downstream usage. Each sentence adds distinct information: ranking criteria, downstream integration, and quota/cap details. No redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema, so the description carries responsibility for return values. It indicates the result includes video IDs and implies metric values, but doesn't specify the exact response structure. Given the simple nature and sibling context, it's adequately complete, though a bit more on return format would be ideal.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameters with descriptions, including defaults and enums. The description reinforces max_results cap and resolve_titles cost but adds little new semantic detail beyond the schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states 'Rank the channel's videos over a date range by views, watch time, average view duration, or subscribers gained.' This is a specific verb and resource, and it distinguishes from sibling tools by noting the returned IDs feed other tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'Use this to find which videos to look at more closely' and names downstream tools. However, it doesn't provide exclusions or compare with sibling tools like yt_video_performance, so it's clear context but not full when-not guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yt_traffic_sourcesWhere views came fromARead-onlyIdempotent
Break views and watch time down by how viewers arrived: YouTube search, suggested/related video, channel page, playlist, external sites, notifications, subscriptions feed, Shorts feed, end screens, and so on. The single most useful diagnostic for 'why did this take off' or 'why did it flatline'. Optionally scope it to one video. Source names come back as the API's own constants (YT_SEARCH, RELATED_VIDEO, EXT_URL, SHORTS, SUBSCRIBER, PLAYLIST, NOTIFICATION, END_SCREEN, NO_LINK_OTHER, and others).
| Name | Required | Description | Default |
|---|---|---|---|
| metrics | No | The traffic-source report supports only views and estimatedMinutesWatched. | |
| end_date | Yes | End date, YYYY-MM-DD, inclusive. YouTube Analytics lags roughly 2-3 days, so ending the range at today usually returns zeros for the last few days. | |
| video_id | No | Optional: restrict to a single video's traffic instead of the whole channel. | |
| start_date | Yes | Start date, YYYY-MM-DD, inclusive. Interpreted in the channel's timezone. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly, idempotent, and non-destructive hints, so the bar is lower. The description adds value by disclosing that source names are returned as API constants (YT_SEARCH, RELATED_VIDEO, etc.), which informs the agent about the exact output format. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, tightly packed with useful information: the breakdown dimension, the diagnostic use case, and the output constant names. No filler or redundancy; every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a 4-parameter tool with no output schema, the description covers the tool's purpose, the meaning of the output constants, and a compelling use case. The schema handles date and video_id details, and annotations cover safety. It does not explicitly describe return structure or pagination, but those are less critical for this read-only diagnostic tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds indirect context about the video_id parameter ('Optionally scope it to one video') and mentions the available metrics indirectly, but it does not add detail beyond what the schema already provides for each parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb phrase 'Break views and watch time down by how viewers arrived' and lists concrete source examples (YouTube search, suggested video, channel page, etc.). This clearly distinguishes it from sibling tools like yt_top_videos or yt_video_performance, which focus on different dimensions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states the diagnostic use case: 'The single most useful diagnostic for why did this take off or why did it flatline.' It gives clear context for when to use the tool, though it does not name specific alternative tools or exclusion criteria, which prevents a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yt_video_performancePerformance of specific videosARead-onlyIdempotent
Metrics for one or more named videos over a date range — the counterpart to yt_top_videos when you already know which videos you care about. Returns one row per video. Note that the window is a reporting window, not the video's lifetime: a range of the last 30 days shows the last 30 days of a video published two years ago. Setting resolve_titles=true spends 1 YouTube Data API quota unit per 50 videos (default daily budget: 10,000 units); the Analytics query itself does not draw on that budget. Pass resolve_titles=false to return bare video IDs and spend none.
| Name | Required | Description | Default |
|---|---|---|---|
| metrics | No | Metrics to return per video. | |
| end_date | Yes | End date, YYYY-MM-DD, inclusive. YouTube Analytics lags roughly 2-3 days, so ending the range at today usually returns zeros for the last few days. | |
| video_ids | Yes | YouTube video IDs (the part after v= in a watch URL), 1 or more. | |
| start_date | Yes | Start date, YYYY-MM-DD, inclusive. Interpreted in the channel's timezone. | |
| resolve_titles | No | Look up each video's title so the result is readable. Setting resolve_titles=true spends 1 YouTube Data API quota unit per 50 videos (default daily budget: 10,000 units); the Analytics query itself does not draw on that budget. Pass resolve_titles=false to return bare video IDs and spend none. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnly/openWorld/idempotent hints, but the description adds crucial context: the reporting window is not the video's lifetime (with a concrete example), and resolve_titles incurs Data API quota while the Analytics query does not. This goes well beyond the annotations and clarifies real-world behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Every sentence carries essential information: purpose, differentiation, return shape, window nuance, and quota behavior. The description is front-loaded with the core purpose and structured logically, with no filler or redundant repetition of schema details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only analytics tool with full schema coverage and no output schema, the description covers the key contextual gaps: when to use it, the reporting-window caveat, and the quota trade-off for title resolution. It also notes the row-per-video format, making it sufficiently complete for an agent to invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds extra meaning by clarifying the date window semantics ('last 30 days of a video published two years ago') and the per-video row structure, which supplements the schema's param descriptions. It doesn't systematically re-iterate each parameter but adds meaningful context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool as providing metrics for specific named videos over a date range, explicitly distinguishing it from the sibling yt_top_videos by the use case 'when you already know which videos you care about.' It also states the return shape ('one row per video'), giving a specific, actionable purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly positions the tool as the counterpart to yt_top_videos and states the condition for using it ('when you already know which videos you care about'). This provides clear guidance on when to choose this tool over its sibling, and the quota note for resolve_titles adds practical usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
9 tool updates
v0.1.0- First observed
yt_audience_retention - First observed
yt_channel_info - First observed
yt_channel_overview - First observed
yt_episode_race - First observed
yt_geography - First observed
yt_playlist_performance - First observed
yt_top_videos - First observed
yt_traffic_sources - First observed
yt_video_performance
TDQS
Each tool targets a distinct analytical facet: channel identity, channel totals, traffic sources, video ranking, specific video metrics, retention curve, geography, playlist performance, and publish-relative comparison. Even overlapping tools (top_videos vs video_performance) are clearly differentiated as discovery vs known-video lookup, and episode_race explicitly reframes comparisons by publish age.
All tool names follow the yt_ prefix with lowercase snake_case descriptive phrases (channel_info, traffic_sources, episode_race). The pattern is uniform and predictable, making it easy to infer a tool's purpose from its name alone.
Nine tools cover the major dimensions of YouTube channel analytics without redundancy or bloat. Each tool addresses a meaningful analysis question, and the count is well within the ideal 3-15 range.
The surface covers core analytics: channel totals, traffic, top videos, per-video metrics, retention, geography, and playlists. A notable gap is demographic breakdowns (age/gender) and possibly device/reporting data, but these are less central and the provided tools cover the primary workflows.
Maintenance
Related MCP Connectors
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents. No signup.
Find YouTube outliers, daily viral Shorts, and analyze video performance.
Read-only website analytics, AI referrals, crawlers, goals, revenue, and funnels.
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI assistants with comprehensive YouTube analytics and channel management capabilities, including channel performance, video analytics, audience insights, and content strategy tools.571-
- AlicenseAqualityCmaintenanceEnables AI assistants to access YouTube organic analytics, including channel stats, video performance, watch time, and audience engagement, via the YouTube Data API v3 and Analytics API v2.640MIT
- FlicenseAqualityCmaintenanceEnables AI assistants to analyze YouTube channels, videos, transcripts, and content strategy through structured tool calls.1757-
- AlicenseNot gradedqualityBmaintenanceProvides AI agents with token-optimized access to YouTube data, including video details, transcripts, channel statistics, trending videos, and search.375MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/conorbronsdon/yt-analytics-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server