Skip to main content
Glama
YouTube Studio MCP

YouTube Studio MCP

by nelsonrogers

Traffic sources

get_traffic_sources
Read-onlyIdempotent

Retrieve views and watch time by traffic source—search, suggested, browse, Shorts feed, external—and drill into top search terms, referring videos, or websites for a source.

Instructions

How viewers find the content: views and watch time by traffic source (search, suggested, browse, Shorts feed, external, ...) or, with source_type, the top search terms / referring videos / websites for that source.

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": "get_traffic_sources"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum rows.
periodNoNamed date range, Studio-style. Rolling ranges end at the latest complete day of data (analytics lag ~2-3 days; dates are US Pacific). Ignored when start_date is set.last_28_days
end_dateNoCustom range end, YYYY-MM-DD (inclusive). Defaults to the latest complete day.
video_idNoLimit to one video (11-character ID, e.g. 'dQw4w9WgXcQ'). Omit for the whole channel.
start_dateNoCustom range start, YYYY-MM-DD. Overrides `period`.
source_typeNoDrill into one source: YT_SEARCH (search terms), RELATED_VIDEO (suggested-video placements), EXT_URL (websites/apps), YT_CHANNEL, SUBSCRIBER, HASHTAGS, SOUND_PAGE, ADVERTISING, YT_OTHER_PAGE. Omit for the overview.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/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. The description adds the meaningful behavioral fact that the result shape changes based on source_type (overview rows vs. top search terms / referring videos / websites), but says nothing about data availability, limits, or freshness beyond what the schema carries.

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?

A single front-loaded sentence with the primary outcome stated first and the conditional drill-down mode second. No filler, no restatement of the title.

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, the description need not explain return shapes, and the input schema fully documents all six parameters. What remains is a clear statement of the two operating modes; only explicit sibling routing would make it fully complete for an agent choosing among many analytics tools.

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 description coverage is 100%, so limits, period, dates, video_id and source_type are all already documented, including the enum meanings. The description only reinforces the source_type semantic ('top search terms / referring videos / websites'), which is a marginal add beyond the schema baseline.

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 description names the resource (traffic sources) and what it returns (views and watch time by source), plus the distinct drill-down mode activated by source_type. It is clear enough to separate from analytical siblings like get_audience_breakdown or get_impressions, but it never explicitly contrasts itself with them.

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?

Usage is implied through 'Omit for the overview', which tells the agent how to switch between the summary and the per-source drill-down. There is no explicit statement of when to prefer this over sibling analytics tools, so selection guidance remains inferential.

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