Skip to main content
Glama

yt_channel_snapshot

Idempotent

Fetch live YouTube channel statistics, recent long-form videos, and Shorts metrics, then write an HTML dashboard and JSON snapshot cache for local channel reporting.

Instructions

Fetch live YouTube channel statistics, recent long-form videos, and Shorts metrics, and write an updated local report.html dashboard and channel_snapshot.json cache on disk. When YouTube OAuth2 credentials are present (and force_public is false), queries YouTube Data API v3 (~3 quota units) and YouTube Analytics API v2 for private owner metrics (averageViewPercentage, swipedAwayRate, engagedViews, estimatedMinutesWatched, subscribersGained); public page scraping is opt-in only (force_public=true or MATEAI_YT_PUBLIC_SCRAPE=1); without OAuth or opt-in it returns setup instructions. Overwrites report.html idempotently on each run.

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

Input Schema

NameRequiredDescriptionDefault
handleNoYouTube channel handle (with or without leading '@', e.g. '@mateai-c6m'). Defaults to '@mateai-c6m'.@mateai-c6m
force_publicNoOpt in to public page scraping for this call (bypasses OAuth2; public views/likes only). Only set when the user asks for it.

Output Schema

NameRequiredDescriptionDefault
modeYes
videosYes
channelYes
dashboardPathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.0
    • removedOutput schema / properties / shorts
      Removed value: -{
      -  "items": {
      -    "type": "object"
      -  },
      -  "type": "array"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "mode",
      -  "channel",
      -  "videos",
      -  "shorts",
      -  "dashboardPath"
      -]New value: +[
      +  "mode",
      +  "channel",
      +  "videos",
      +  "dashboardPath"
      +]
  2. Changed1 schema field changedv0.3.0
    • changedInput schema / properties / force_public / description
      Previous value: -"If true, bypass stored OAuth2 tokens and use zero-config public scraping only."New value: +"Opt in to public page scraping for this call (bypasses OAuth2; public views/likes only). Only set when the user asks for it."
  3. Changed6 schema fields changedv0.2.0
    • addedInput schema / properties / force_public / default
      Added value: +false
    • changedInput schema / properties / force_public / description
      Previous value: -"If true, use zero-config public snapshot even if OAuth token exists."New value: +"If true, bypass stored OAuth2 tokens and use zero-config public scraping only."
    • addedInput schema / properties / handle / default
      Added value: +"@mateai-c6m"
    • changedInput schema / properties / handle / description
      Previous value: -"YouTube channel handle (e.g. '@mateai-c6m'). Defaults to '@mateai-c6m'."New value: +"YouTube channel handle (with or without leading '@', e.g. '@mateai-c6m'). Defaults to '@mateai-c6m'."
    • addedInput schema / properties / handle / pattern
      Added value: +"^@?[A-Za-z0-9._-]+$"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "channel": {
      +      "type": "object"
      +    },
      +    "dashboardPath": {
      +      "type": "string"
      +    },
      +    "mode": {
      +      "enum": [
      +        "studio_oauth",
      +        "public_scrape"
      +      ],
      +      "type": "string"
      +    },
      +    "shorts": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "videos": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "mode",
      +    "channel",
      +    "videos",
      +    "shorts",
      +    "dashboardPath"
      +  ],
      +  "type": "object"
      +}
  4. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag the tool as write-capable but non-destructive and idempotent; the description corroborates and enriches this by naming the two files written, stating report.html is overwritten idempotently each run, and disclosing the ~3 quota unit cost plus the two upstream APIs used. The fallback to setup instructions when credentials are absent is exactly the kind of failure behavior an agent needs and cannot get from annotations.

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?

Purpose and outputs are front-loaded, and each subsequent clause carries operational information (auth path, quota, opt-in scraping, fallback). The dense semicolon-chained sentences make it harder to scan than a short bulleted structure would, which is the only real cost.

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?

Output schema exists, so return values need no prose, and the description instead covers what the output schema cannot: side effects on disk, overwrite semantics, quota cost, and the degraded-mode response. For a default-argument, side-effecting tool this covers everything needed to invoke it correctly.

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 explaining that force_public bypasses OAuth2 and yields public views/likes only, and by tying the env-var equivalent to the same switch. Handle semantics are left entirely to the schema, which is acceptable given its pattern and default are documented.

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 opens with a specific verb+resource pairing: fetch live YouTube channel statistics, recent long-form videos, and Shorts metrics, plus write a local report.html and channel_snapshot.json. It names exactly what is produced and where it lands, which lets an agent distinguish it from the analytics-only siblings such as yt_video_details or yt_shorts_experiment_table.

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 clearly states the conditions that select different behaviors: OAuth credentials present and force_public false triggers the API path; force_public=true or MATEAI_YT_PUBLIC_SCRAPE=1 opts into scraping; neither results in setup instructions being returned rather than data. It does not explicitly contrast against sibling tools for single-video or comment queries, which keeps it short of a 5.

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