list_comments
Retrieve top-level comments from a YouTube video, sorted newest first, with comment IDs, authors, text, and like counts.
Instructions
List top-level comment threads on a video (newest first). Returns comment IDs, authors, text, and like counts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| video_id | Yes | Video ID to list comments from | |
| max_results | No |
Implementation Reference
- src/youtube/client.ts:206-213 (helper)YouTubeClient helper method that calls the YouTube Data API v3 /commentThreads endpoint to fetch top-level comments for a video.
listComments(videoId: string, maxResults = 20): Promise<{ items: CommentThread[] }> { return this.dataGet("/commentThreads", { part: "snippet,replies", videoId, maxResults: String(maxResults), order: "time", }); } - src/youtube/types.ts:58-75 (schema)TypeScript type definition for CommentThread returned by the YouTube API, used as the response type for listComments.
export interface CommentThread { id: string; snippet?: { topLevelComment?: { id: string; snippet: { authorDisplayName: string; authorChannelId?: { value: string }; textDisplay: string; textOriginal: string; likeCount: number; publishedAt: string; updatedAt: string; moderationStatus?: "heldForReview" | "likelySpam" | "published" | "rejected"; }; }; totalReplyCount?: number; };