Skip to main content
Glama

rank_videos_by_topic

Find the videos that talk about something the most, ranked by how many sentences mention it. Better than searching titles when you want the videos that really go deep on a topic. Each result has the number of mentions, the first mention and a link. Read the best ones with get_youtube_transcript or find_in_transcript. Same library, caption quirks and dates as search_spoken_words.

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": {
      "query": "<query>"
    },
    "name": "rank_videos_by_topic"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoHow many videos. Default 10.
queryYesA word or short phrase (up to 8 words).
sinceNoOnly captions captured on or after this date, YYYY-MM-DD.
untilNoOnly captions captured on or before this date, YYYY-MM-DD.
channelNoOnly this channel: a channel ID (UC...) or part of the channel name.
also_matchNoOther spellings or mis-hearings to count as the same thing. Up to 5.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the load and does well: it discloses the result shape (mention count, first mention, link), notes caption quirks and date handling, and points to search_spoken_words for the shared library behavior. It doesn't state read-only semantics, cost, or result caps beyond the limit parameter.

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?

Front-loaded with the core behavior and each following sentence adds routing or result detail. Slightly conversational phrasing ("really go deep on a topic") costs a little density but no sentence is wasted.

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 six-parameter search tool with no output schema, the description covers ranking semantics, return fields, library quirks, and next steps. The only gap is that it never says the corpus is captions/transcripts directly, leaving that to inference from the sibling reference.

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 every parameter including also_match and the date bounds is already documented in the schema. The description only adds the framing that mentions are counted per sentence, which is baseline value when the schema does the heavy lifting.

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 plus the ranking mechanism: videos ranked by how many sentences mention the query. It also explicitly contrasts itself with title search, so an agent can tell it apart from search_youtube_videos 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Better than searching titles when you want the videos that really go deep on a topic" gives a clear selection criterion, and it routes follow-up work to get_youtube_transcript and find_in_transcript. It stops short of naming the title-search sibling explicitly or stating when not to use this tool.

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.