Skip to main content
Glama

Search YouTube for videos on a subject

search_youtube
Read-only

What creators are publishing about a subject, in the order YouTube ranks it: title, channel, exact view count, duration and the description snippet, plus real upload dates, likes and comments when the deployment holds a Data API key (stats: "exact"). Read from the results page rather than the API's 100-unit search, so one key's day holds thousands of these. The answer is cached for thirty minutes, and the same question again costs nothing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "q": "<q>"
    },
    "name": "search_youtube"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYesWhat to search for, the way you would type it into YouTube.
sortNo`relevance` uses YouTube's ranking. `views` puts the most-watched videos first. Combine `views` with `recency` to find popular uploads within that window, not to measure growing views. Without a window, `views` includes all-time hits.relevance
limitNoVideos to return, 1–20. One page is one read: a larger `limit` on the same question is served from it.
countryNoThe country to rank for, ISO 3166-1 alpha-2 (BR, US, ES). Omit it for YouTube's own ranking rather than a country's.
recencyNoOnly videos uploaded within the window: `day`, `week`, `month` or `year`. Absent means any time.
refreshNoRead the page again instead of serving the half-hour cache. Charged like any read, and the fresh answer replaces the cached one.
languageNoThe language to ask and read the page in, ISO 639-1 (en, pt, es). Omit it and your `accept-language` header decides.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

With annotations already declaring readOnly/openWorld/non-destructive, the description still adds substantial behavior: exact likes/comments require a Data API key (`stats: "exact"`), results come from the results page rather than the metered 100-unit search API, responses are cached for thirty minutes, and repeats are free. That is precisely the cost and freshness context an agent needs before choosing this over another call.

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 tight sentences, front-loaded with what is returned and followed by cost and cache behavior; almost every clause earns its place. The parenthetical `stats: "exact"` is the one term an agent cannot resolve against the schema and costs a little clarity.

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?

For a 7-parameter read tool with no output schema, the description covers the return shape, ranking semantics, quota economics, caching and the API-key dependency well. It does not address empty-result behavior or what happens when no Data API key is present beyond omitting likes/comments, which is a minor remaining gap.

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 coverage is 100%, so the baseline is 3 and the schema already explains `sort`, `recency`, `country`, `language`, `limit` and `refresh`. The description adds marginal semantics (a larger `limit` on the same question is served from the cached page), but it also references a `stats: "exact"` field that does not appear anywhere in the input schema, which muddies rather than clarifies parameter meaning.

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 and resource ("What creators are publishing about a subject") plus the ranking source and the exact fields returned (title, channel, view count, duration, snippet). The platform-specific framing makes it immediately distinguishable from search_github, search_instagram and search_news without opening a schema.

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 by the framing of a subject-level discovery search, and the description explains when to use `refresh` versus the cache. But there is no explicit when-to-use/when-not guidance against siblings such as lookup_post (a known video) or list_trending (browsing without a query), so the agent must infer the boundary.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources