Skip to main content
Glama
YouTube MCP Server

YouTube MCP Server

Detect unusual days (OAuth)

detect_anomalies
Read-onlyIdempotent

Detect recent days with unusual YouTube view spikes or drops against a median baseline and flag days that lost subscribers.

Instructions

Find recent days with unusual views (spikes and drops against the median of the days before) and days that lost subscribers.

Data ends ~2 days ago because analytics lag. Requires OAuth.

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

Input Schema

NameRequiredDescriptionDefault
daysNoRecent days to check.
thresholdNoSpike: views >= threshold x baseline median; drop: <= median / threshold.
baseline_daysNoDays before each checked day used as its baseline.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/non-destructive/openWorld, so the lower bar is met; the description adds real context beyond them by disclosing the ~2-day analytics lag and the OAuth requirement. It also explains the anomaly logic (deviation from a prior-days median), which helps the agent interpret results rather than just call the tool.

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?

Two compact sentences with the capability front-loaded and operational caveats (lag, auth) following. Every clause carries information; nothing is redundant.

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?

An output schema exists, so return-value documentation is not required. Given a zero-required-parameter, three-param detection tool, the description supplies the operational constraints an agent needs (auth, data recency) and the definition of what counts as an anomaly.

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%, with all three parameters documented including defaults and bounds, so the baseline is 3. The description reinforces the median-baseline concept behind threshold and baseline_days but adds no syntax or format detail beyond the schema.

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 a specific analytical operation: finding recent days with anomalous views (spikes/drops relative to the median of preceding days) plus days with subscriber losses. This is clearly distinct from raw metric tools like get_channel_analytics or get_revenue, though no sibling is named explicitly.

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 rather than stated: the agent can infer this is for anomaly detection rather than pulling raw analytics. Useful operating context is given (data lags ~2 days, OAuth required), but there is no explicit when-to-use/when-not or alternative-tool routing.

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