Skip to main content
Glama
l4b4r4b4b4

YouTube MCP Server

by l4b4r4b4b4

get_video_transcript_preview

Retrieve a preview of a YouTube video transcript to decide if the full text is needed. Cached permanently with no API quota usage.

Instructions

Get a preview of a YouTube video transcript.

Retrieves the first N characters of a video transcript for quick preview.
Useful for deciding if you need the full transcript.
Cached permanently as transcript content doesn't change.

Args:
    video_id: YouTube video ID (e.g., "dQw4w9WgXcQ")
    language: Language code (e.g., "en"). If empty, uses first available
    max_chars: Maximum characters to return (default: 2000)

Returns:
    TranscriptPreview dictionary with:
    - video_id, language, preview text
    - total_length: Total characters in full transcript
    - is_truncated: Whether preview is truncated

Example:
    >>> preview = get_video_transcript_preview("nLwbNhSxLd4", max_chars=500)
    >>> print(preview["preview"][:50])
    "Welcome to this NixOS tutorial..."

Note:
    - Uses no YouTube API quota
    - Cached permanently in youtube.content namespace
    - Use list_available_transcripts first to see language options

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
languageNo
video_idYes
max_charsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Describes caching behavior (permanent, no quota), return structure (TranscriptPreview dictionary), and includes example. The generic caching boilerplate at the end is not specific to this tool but doesn't contradict.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Main description is clear and structured, but the appended generic caching behavior block is long and not tool-specific, reducing conciseness.

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?

Given output schema exists and description covers inputs, outputs, caching, quota, and includes examples, it is complete for an AI agent to use effectively.

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?

All three parameters (video_id, language, max_chars) are explained with examples and default behaviors, adding significant value beyond the schema with 0% description coverage.

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?

Clearly states it retrieves a preview (first N characters) of a YouTube video transcript. Distinguishes from siblings like get_full_transcript and list_available_transcripts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Explicitly says 'Useful for deciding if you need the full transcript' and 'Use list_available_transcripts first to see language options'. Also notes permanent caching.

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