YouTube for AI Agents

v0.3.5
io.github.JCodesMore/youtube-for-ai-agents Checked 6 hours ago Published 3 days ago

Search YouTube, read transcripts, see frames, read comments, and clip videos.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

youtube_get_transcript Get video transcript

Read what is said in a YouTube video: its captions or auto-generated transcript, with timestamps. This is how to watch, summarise, quote or fact-check a video. Defaults to the spoken language. Pass "language" to get another one, translated by YouTube if needed. Long videos come back in parts (see nextStartTime). Use startTime/endTime to read one section.

ParameterTypeDescription
videoId *stringYouTube video URL (any form: watch, youtu.be, Shorts, live) or 11-character video ID
endTimenumberOnly return captions before this time, in seconds.
formatstring"timestamped" (default): one line per caption with [m:ss] times, compact and good for citing moments or clipping. "text": plain prose, smallest. "segments": JSON array with offset/duration in seconds.
languagestringLanguage code such as "en" or "es". Default: the language the video is spoken in. If the video has no captions in the requested language, YouTube translates them.
maxSegmentsintegerCap the number of captions returned (max 5000), for a quick preview.
startTimenumberOnly return captions at or after this time, in seconds. Use it with chapter times from youtube_get_video_info, or with nextStartTime to read the next page of a long transcript.

youtube_get_video_info Get video details

Details of a YouTube video: title, channel, views, likes, upload date, duration, description, and with detail "full" its chapters (with timestamps), tags and thumbnail. "brief" returns key stats only; "standard" is the default.

ParameterTypeDescription
videoId *stringYouTube video URL (any form: watch, youtu.be, Shorts, live) or 11-character video ID
detailstringDetail level — "brief" (key metadata only), "standard" (most fields, truncated description, no chapters), or "full" (everything). Default: standard

youtube_get_comments Read comments

Read a YouTube video's comments, most liked or newest first: author, text, likes, age, reply count, and whether the creator pinned, wrote or hearted it; pass replies to read into the threads. Good for audience reaction, corrections people point out, and recipes or links shared in the comments.

ParameterTypeDescription
videoId *stringYouTube video URL or 11-character video ID
limitintegerHow many top-level comments to return (default 30, max 300)
repliesintegerAlso read up to this many replies under each comment that has some (default 0, max 20). Corrections and creator answers often sit in the replies.
sortstring"top" (default, most liked first) or "newest"

youtube_get_frames See video frames

Look at a YouTube video: returns still frames, as images, at the times you choose. Use it for what the transcript cannot tell you: slides, code, charts, products, on-screen text, or what a scene looks like. Choose times from transcript timestamps or chapters. Up to 10 per call. The first use downloads yt-dlp and ffmpeg (about a minute).

ParameterTypeDescription
times *arrayMoments to look at: seconds (90), MM:SS ("1:30") or HH:MM:SS. Up to 10. Pick them from transcript timestamps or chapter times.
videoId *stringYouTube video URL or 11-character video ID
outputDirstringAlso keep the frames as JPEG files in this folder. By default they are only returned as images.
qualitystringFrame resolution (default 720p). Use 1080p to read small on-screen text or code.

youtube_get_channel_videos List channel videos

List a YouTube channel's videos, Shorts or live streams (one tab per call; default videos), newest, most popular or oldest first. Accepts an @handle, a channel URL or a channel ID. Page with offset when the result says hasMore.

ParameterTypeDescription
channelUrl *string@handle, full YouTube URL, or channel ID
limitnumberMax videos to return (default: 30, max: 500)
offsetintegerSkip this many videos first, to page past a previous call (use when the result says hasMore)
sortstringSort order (default: newest)
tabstringWhich tab to list: "videos" (default, long-form uploads), "shorts", or "live" (current and past live streams)

youtube_get_channel_info Get channel details

Details of a YouTube channel: name, handle, description, subscribers, video count, total views, join date and country. Accepts an @handle, a channel URL or a channel ID.

ParameterTypeDescription
channelId *string@handle, full YouTube URL, or channel ID

youtube_get_playlist Get playlist

A YouTube playlist's title, description, owner and its videos in order, with each video's channel, length, views and age where YouTube shows them. Accepts a playlist URL or ID, Mix links included. Page with offset when the result says hasMore.

ParameterTypeDescription
playlistId *stringYouTube playlist URL or ID (e.g. PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf). Mix links (list=RD…) work too.
limitnumberMax videos to return (default: 30, max: 200)
offsetintegerSkip this many videos first, to page past a previous call (use when the result says hasMore)

youtube_download Download video or audio

Save a YouTube video, or just its audio, to a local file. Default 720p MP4, or M4A for audio; outputPath can be a file or a folder. Videos over 30 minutes (audio over 3 hours) return a warning first; pass force: true to go ahead. The first use downloads yt-dlp and ffmpeg (about a minute).

ParameterTypeDescription
videoId *stringYouTube video URL (any form: watch, youtu.be, Shorts, live) or 11-character video ID
forcebooleanBypass the duration guard (by default video over 30 minutes, audio over 3 hours; both set with the "config" command)
formatstringFile format: mp4 (default), webm or mkv for video; m4a (default), mp3, opus or wav for audio
outputPathstringOutput file path, or a folder to save <title>.<format> in (defaults to the current folder)
qualitystringVideo quality (default: 720p)
typestringDownload type — "video+audio" (default), "audio" (audio only), or "video" (no audio)

youtube_clip Cut clips

Cut one or more clips from a YouTube video by timestamp. Only the requested ranges are downloaded, so clipping a long video is fast. Each clip needs startTime and endTime (seconds, MM:SS, HH:MM:SS or 1m30s) and an optional label for the file name. Keep clips tight: one moment each, usually 5-30 seconds. Pass highlightReel: true to also join 2+ clips into one highlight reel. Set accurate: true for highlight reels or whenever cuts must land exactly (it re-encodes around the cut points, a little slower); without it, cuts snap to the nearest keyframe and can drift a second or two.

ParameterTypeDescription
clips *arrayOne or more clip definitions with start/end timestamps
videoId *stringYouTube video URL (any form: watch, youtu.be, Shorts, live) or 11-character video ID
accuratebooleanExact cuts: re-encodes around each cut point so the clip starts and ends on the given times. Recommended for highlight reels. Default false: cuts snap to keyframes and may include a second or two extr…
forcebooleanBypass the duration guard for long videos
highlightReelbooleanWith 2+ clips, also join them into one highlight-reel video (default: false). Set to true when a reel was asked for.
outputDirstringOutput directory for clip files (defaults to current directory)
qualitystringVideo quality (default: 720p)

youtube_highlight_reel Join clips into a reel

Join existing clip files, for example from several youtube_clip calls across different videos, into one highlight reel MP4. Pass the file paths in playback order.

ParameterTypeDescription
clips *arrayFile paths to existing clip/video files, in your desired playback order
labelstringName for the reel file — produces "{label}.mp4" (default: "highlight-reel")
outputDirstringOutput directory for the highlight reel (defaults to current directory)