Skip to main content
Glama
l4b4r4b4b4

YouTube MCP Server

by l4b4r4b4b4

get_video_comments

Retrieve top comments from a YouTube video with engagement metrics like like count and timestamp to analyze audience feedback.

Instructions

Get top comments for a YouTube video with engagement metrics.

Retrieves top-level comments (no replies) sorted by relevance.
Comments are cached for 5 minutes. Returns empty list if comments
are disabled for the video.

Args:
    video_id: YouTube video ID (e.g., "dQw4w9WgXcQ")
    max_results: Maximum comments to return (1-100, default: 20)

Returns:
    Dictionary with video_id, comments list, and total_returned.
    Each comment includes author, text, like_count, published_at.

Example:
    >>> comments = get_video_comments("nLwbNhSxLd4", max_results=10)
    >>> print(comments["comments"][0]["author"])

Note:
    - Costs 1 quota unit per request
    - Cached for 5 minutes in youtube.comments namespace
    - Returns empty list if comments disabled (not an error)

Caching Behavior:

  • Parameters that accept reference strings can accept a ref_id from a previous tool call

  • Large results return ref_id + preview; use get_cached_result to paginate

  • All responses include ref_id for future reference

Ref input compatibility: Support depends on the tool's input schema/validation. Some strictly typed parameters may reject string ref_ids before resolution.

Full retrieval: Use get_cached_result(ref_id, full=True) to get the complete value.

Preview Size: server default. Override per-call with get_cached_result(ref_id, max_size=...).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
video_idYes
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations are provided, so the description fully covers behavioral aspects: caching for 5 minutes, quota cost of 1 unit, empty list return when comments disabled, and reference IDs. The generic caching boilerplate adds context about the caching system, but is not tool-specific.

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?

The description is well-structured with clear sections (Args, Returns, Example, Note). However, it includes a lengthy generic caching block repeated across tools, which reduces conciseness. The specific part is concise.

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?

The description covers parameters, output structure (dictionary with comments list and fields), caching, and quota. It does not mention error handling for invalid video_id, but overall completeness is high given the presence of an output schema (not shown but described).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% coverage, but the description adds full semantics: video_id format with example, max_results range (1-100) and default (20). This is superior to a typical cryptic schema.

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?

The description clearly states the tool's function: retrieving top-level comments for a specific YouTube video with engagement metrics, sorted by relevance. It explicitly distinguishes from sibling tools like semantic_search_comments by specifying top-level comments only.

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?

The description provides context on when to use (getting comments for a video), what is returned (top-level, no replies), and caching behavior. It lacks explicit exclusion criteria or references to alternative tools for replies, but the specificity is adequate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/l4b4r4b4b4/yt-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server