Skip to main content
Glama
granitebps

YouTube MCP Server

by granitebps

search_youtube

Search YouTube videos by query and return up to 50 results with title, channel, views, duration, and URL; filter by upload date or duration and sort by relevance, date, views, or rating.

Instructions

Search YouTube videos by query. Returns up to 50 results with title, channel, views, duration, and URL. Supports filtering by uploadDate (today/week/month/year) and videoDuration (short/medium/long), and sorting by relevance, date, viewCount, or rating. Served by the provider selected with YT_PROVIDER; with the default innertube provider some options are approximated and reported in warnings.

Input Schema

NameRequiredDescriptionDefault
queryYesSearch query string
sortByNoSort order: 'relevance' (default), 'date', 'viewCount' (most popular), or 'rating'. With the default innertube provider, 'date' keeps relevance order and 'rating' sorts by popularity, each with a warning; the api provider applies all four exactly.relevance
maxResultsNoMaximum number of results to return (1-50)
uploadDateNoFilter by upload date: 'any', 'hour', 'today', 'week', 'month', 'year'. With the innertube provider, 'hour' is applied as 'today' with a warning.any
videoDurationNoFilter by duration: 'any', 'short', 'medium', 'long'. innertube: <3min, 3-20min, >20min. api: <4min, 4-20min, >20minany

Output Schema

NameRequiredDescriptionDefault
queryYes
sortByYes
resultsYes
warningsNoRequested options that YouTube search could not apply exactly
uploadDateYes
resultCountYes
videoDurationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.1.0
    • changedInput schema / properties / sortBy / description
      Previous value: -"Sort order: 'relevance' (default), 'date' (newest), 'viewCount' (most popular), 'rating' (highest rated)"New value: +"Sort order: 'relevance' (default), 'date', 'viewCount' (most popular), or 'rating'. With the default innertube provider, 'date' keeps relevance order and 'rating' sorts by popularity, each with a warning; the api provider applies all four exactly."
    • changedInput schema / properties / uploadDate / description
      Previous value: -"Filter by upload date: 'any', 'hour', 'today', 'week', 'month', 'year'"New value: +"Filter by upload date: 'any', 'hour', 'today', 'week', 'month', 'year'. With the innertube provider, 'hour' is applied as 'today' with a warning."
    • changedInput schema / properties / videoDuration / description
      Previous value: -"Filter by duration: 'any', 'short' (<3min), 'medium' (3-20min), 'long' (>20min)"New value: +"Filter by duration: 'any', 'short', 'medium', 'long'. innertube: <3min, 3-20min, >20min. api: <4min, 4-20min, >20min"
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "description": "Requested options that YouTube search could not apply exactly",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "code",
      +      "message"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden and largely meets it: it discloses the 50-result cap, provider dependence via YT_PROVIDER, and importantly that the default innertube provider approximates some options and emits warnings while the api provider applies them exactly. It omits auth requirements and rate limits, but the degradation caveats are the most valuable trait an agent needs here.

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?

Three dense sentences, front-loaded with the core action and return shape before the parameter summary and the provider caveat. The enumeration of return fields (title, channel, views, duration, URL) slightly duplicates the output schema, but overall there is little waste.

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?

An output schema exists, so return-shape explanation is optional, yet the description covers filtering, sorting, provider-dependent fidelity, and warnings, which is ample for a 5-parameter tool. Minor gap: 'Returns up to 50 results' can be read as the default result count when the schema states maxResults defaults to 10.

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 the schema already documents query, sortBy, maxResults, uploadDate, and videoDuration with enum meanings and provider caveats. The description restates the same filter and sort options without adding syntax or format detail beyond the schema, which is the expected baseline.

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+resource ('Search YouTube videos by query') with the discovery scope made explicit. It is immediately distinguishable from siblings like get_video_info, get_video_comments, and get_video_transcript, which all operate on a known video rather than searching.

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?

The filtering, sorting, and provider context imply when the tool is useful, but the description never states usage conditions relative to alternatives (e.g. 'use get_video_info once you have a video ID'). Guidance is inferable rather than explicit, and no exclusions are given.

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