Skip to main content
Glama

youtube_search

YouTube search with cursor pagination — typed hits, ids, canonical URLs, filters (2 credits/page, 0 when a page finds nothing). Costs 2 credits. Empty results and failures are never charged. Pass cache=true for a free 24h cache hit (default always fresh).

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

Input Schema

NameRequiredDescriptionDefault
qYesSearch query or keywords (min 2 characters).
typeNoall | videos | shorts | channels | playlists.
cacheNoSet true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh.
limitNoMax items to return (default 20, max 200). Flat 2 credits per call.
cursorNoPagination cursor. Leave empty for the first page; then pass the nextCursor value returned in the previous response.
fieldsNoOptional comma-separated keys to keep on each result row (or on the object for single-item tools), e.g. id,url,publishedAt,engagement. Pagination keys are always kept. Does not change the price.
regionNoISO country code for localized results (default US).
sortByNorelevance | views (alias: popular→views). date and rating answer 400 SORT_NOT_SUPPORTED: YouTube no longer orders search by upload date (use uploadDate) or by rating. With type=shorts only relevance is supported.
compactNoDefault true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. On Threads, Facebook, Meta Ad Library and TikTok Shop tools request timings are dropped too. Pass false for the full body.
durationNoany | under_4 | 4_20 | over_20. Applies to long-form videos (not Shorts).
uploadDateNoany | today | this_week | this_month | this_year.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / compact / description
      Previous value: -"Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. Pass false for the full body."New value: +"Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. On Threads, Facebook, Meta Ad Library and TikTok Shop tools request timings are dropped too. Pass false for the full body."
  2. Changed2 schema fields changed
    • addedInput schema / properties / compact
      Added value: +{
      +  "default": true,
      +  "description": "Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. Pass false for the full body.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "Optional comma-separated keys to keep on each result row (or on the object for single-item tools), e.g. id,url,publishedAt,engagement. Pagination keys are always kept. Does not change the price.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / sortBy / description
      Previous value: -"relevance | date | views | rating (alias: popular→views)."New value: +"relevance | views (alias: popular→views). date and rating answer 400 SORT_NOT_SUPPORTED: YouTube no longer orders search by upload date (use uploadDate) or by rating. With type=shorts only relevance is supported."
  4. Changed1 schema field changed
    • changedInput schema / properties / cache / description
      Previous value: -"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits."New value: +"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh."
  5. Changed7 schema fields changed
    • changedInput schema / properties / cache / description
      Previous value: -"Set true to serve from the 24h response cache. Default false — always fetch fresh data."New value: +"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits."
    • changedInput schema / properties / cursor / description
      Previous value: -"Pagination cursor from nextCursor."New value: +"Pagination cursor. Leave empty for the first page; then pass the nextCursor value returned in the previous response."
    • changedInput schema / properties / duration / description
      Previous value: -"any | under_4 | 4_20 | over_20."New value: +"any | under_4 | 4_20 | over_20. Applies to long-form videos (not Shorts)."
    • changedInput schema / properties / limit / description
      Previous value: -"Max items to return. Default 20, max 200. Billed per result."New value: +"Max items to return (default 20, max 200). Flat 2 credits per call."
    • changedInput schema / properties / q / description
      Previous value: -"Search query or keywords (min 2 chars)."New value: +"Search query or keywords (min 2 characters)."
    • changedInput schema / properties / region / description
      Previous value: -"ISO country code (default US)."New value: +"ISO country code for localized results (default US)."
    • changedInput schema / properties / sortBy / description
      Previous value: -"relevance | date | views | rating."New value: +"relevance | date | views | rating (alias: popular→views)."
  6. Changed6 schema fields changed
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Pagination cursor from nextCursor.",
      +  "type": "string"
      +}
    • addedInput schema / properties / duration
      Added value: +{
      +  "description": "any | under_4 | 4_20 | over_20.",
      +  "type": "string"
      +}
    • addedInput schema / properties / region
      Added value: +{
      +  "description": "ISO country code (default US).",
      +  "type": "string"
      +}
    • addedInput schema / properties / sortBy
      Added value: +{
      +  "description": "relevance | date | views | rating.",
      +  "type": "string"
      +}
    • addedInput schema / properties / type
      Added value: +{
      +  "description": "all | videos | shorts | channels | playlists.",
      +  "type": "string"
      +}
    • addedInput schema / properties / uploadDate
      Added value: +{
      +  "description": "any | today | this_week | this_month | this_year.",
      +  "type": "string"
      +}
  7. Changed1 schema field changed
    • changedInput schema / properties / cache / description
      Previous value: -"Responses are cached for 24 hours by default. Set false to bypass the cache and always fetch fresh data (default true)."New value: +"Set true to serve from the 24h response cache. Default false — always fetch fresh data."
  8. Changed1 schema field changed
    • addedInput schema / properties / cache
      Added value: +{
      +  "description": "Responses are cached for 24 hours by default. Set false to bypass the cache and always fetch fresh data (default true).",
      +  "type": "boolean"
      +}
  9. First observed

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full behavioral burden and does substantial work: it discloses pricing (2 credits/page), that empty pages and failures are never charged, and that cache=true serves a 24h cached response for free. It does not cover auth requirements, rate limits, or response shape beyond "typed hits," which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The lead clause is well front-loaded, but the cost story is stated twice ("2 credits/page, 0 when a page finds nothing" followed by "Costs 2 credits. Empty results and failures are never charged"), which is redundant in an already dense sentence. The cache point is also repeated between the description and the parameter schema.

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 an 11-parameter, no-output-schema, no-annotation search tool, the description covers the operational essentials an agent needs: cost model, failure billing, caching, and pagination intent. Sort/filter constraints and result fields are delegated to the schema, which is acceptable given 100% coverage, though return-value shape is only sketched.

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 every parameter is already documented in the schema and the baseline is 3. The description reinforces cost semantics tied to paging ("2 credits/page, 0 when a page finds nothing") and the cache default, but adds no new meaning about limit, cursor, sortBy, or compact beyond what the schema states.

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 opens with a specific verb+resource ("YouTube search") and enumerates what the tool returns (typed hits, ids, canonical URLs, filters), which separates it from channel-specific siblings like youtube_channel_videos or youtube_hashtag_search. It stops short of explicitly naming when a sibling is the better choice, so it is clear but not fully differentiated.

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?

Guidance is present but mostly parameter-level: "Pass cache=true for a free 24h cache hit (default always fresh)" tells the agent how to trade freshness for cost. There is no explicit statement of when to use this general search versus the many sibling search/detail tools, so selection guidance is only implied by the name and purpose line.

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.