Skip to main content
Glama

Get YouTube transcript

get_transcript
Read-onlyIdempotent

Fetch YouTube video transcripts with timestamps in text, JSON, SRT, or WebVTT formats; choose caption languages and continue long transcripts by start time.

Instructions

Fetch the transcript (captions) of a YouTube video: what is said in it, with timestamps. Default output is plain text, one "[HH:MM:SS.mmm] text" line per caption, preceded by a header line with the video ID, language, language code and whether the captions are auto-generated. format "json" returns compact JSON {video_id, language, language_code, is_generated, snippets:[{text, start, duration}]}; "srt" and "webvtt" return subtitle files exactly as the API formats them (no header). Languages are tried in the order given and the first available one is returned; if none exists the tool says so, and list_transcripts shows what is available. Output longer than max_characters is cut at a whole line with a note telling you how to read on with start_seconds. A request can take up to about 75 seconds for uncached videos. Each call (including one with start_seconds) counts as one request against the user's plan.

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": {
      "video": "<video>"
    },
    "name": "get_transcript"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNo"manual" = human-made captions only, "generated" = YouTube auto-generated only, "any" (default) = manual if available, else auto-generated.any
videoYesThe YouTube video. Pass the 11-character video ID (e.g. dQw4w9WgXcQ) or a YouTube video URL: youtube.com/watch?v=ID, youtu.be/ID, youtube.com/shorts/ID, youtube.com/embed/ID, youtube.com/live/ID (m.youtube.com and music.youtube.com work too). Other youtube.com URLs with a v= parameter also work.
formatNo"text" (default, most compact; best for reading, summarizing or quoting), "json" (snippets with start and duration in seconds, for precise timing), "srt" or "webvtt" (subtitle files, when the user wants one).text
languagesNoLanguage codes (BCP 47, e.g. "en", "es", "pt-BR", "zh-Hans") in priority order; the first one available is returned. At most 10. Default ["en"]. If unsure which exist, call list_transcripts first.
start_secondsNoOnly return captions that start at or after this time in seconds (text and json formats only). Use the value from a truncation note to continue reading a long transcript. Default 0.
max_charactersNoMaximum characters of transcript to return (default 100,000, roughly 25k tokens or about 1.5-2 hours of speech). Longer output is cut at a whole line with a note. Lower it to save context, raise it to get a long video in one call.
preserve_formattingNoKeep YouTube's HTML formatting tags (<i>, <b>) in caption text. Default false. Rarely needed; bypasses the API's cache.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, openWorld), the description discloses latency (~75s for uncached videos), quota cost (each call including start_seconds counts as one request against the plan), truncation behaviour with a continuation note, an exact output layout including the header line, and that preserve_formatting bypasses the cache. These are precisely the operational facts an agent cannot infer from structured fields.

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 purpose and default output format are front-loaded, and each subsequent sentence carries distinct information (format variants, language order, truncation, latency, quota). It is a single dense block with some redundancy against the schema's own format descriptions, which is the only thing keeping it below 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates fully by documenting the exact text line format, the JSON object keys, srt/webvtt behaviour, and the truncation note. Combined with latency and quota disclosure, an agent has everything needed to call this correctly and to interpret what comes back.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds value by spelling out the JSON payload shape for format="json", the absence of a header for srt/webvtt, and the line-boundary truncation plus start_seconds continuation semantics. It largely mirrors schema wording for languages and max_characters, which keeps it from a 5.

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?

"Fetch the transcript (captions) of a YouTube video" names a specific verb and resource, then immediately disambiguates by describing the three output families (text, json, srt/webvtt). It also separates itself from list_transcripts by pointing to it only as a discovery aid, so an agent can pick this tool without opening the 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?

It gives concrete selection context: language codes are tried in order and the first available is returned, list_transcripts is the fallback when none exist, and start_seconds is how to continue after truncation. It stops short of explicit when-not-to-use conditions (e.g. non-YouTube sources), so it is clear context rather than a full decision rule.

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