Skip to main content
Glama
dabidstudio

YouTube Insights MCP Server

by dabidstudio

get_youtube_transcript

Extract transcripts from YouTube videos by providing the video URL. Access captions and subtitles to analyze content, enable research, or support accessibility needs.

Instructions

Get the transcript of a YouTube video

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • The main handler function that implements get_youtube_transcript logic. Extracts video ID from URL, fetches transcript using YouTubeTranscriptApi with Korean and English language preference, and returns concatenated transcript text.
    def get_youtube_transcript(url: str) -> str:
        """Get the transcript of a YouTube video"""
        video_id_match = re.search(r"(?:v=|\/)([0-9A-Za-z_-]{11}).*", url)
        if not video_id_match:
            raise ValueError("Invalid YouTube URL provided")
        video_id = video_id_match.group(1)
        
        languages = ["ko", "en"]
        try:
            transcript_list = YouTubeTranscriptApi.get_transcript(video_id, languages=languages)
            
            transcript_text = " ".join([entry["text"] for entry in transcript_list])
            return transcript_text
    
        except Exception as e:
            raise RuntimeError(f"Could not find or use the transcript for video ID '{video_id}'. {e}")
  • FastMCP automatically generates the tool schema from Python type hints (url: str) -> str and the docstring. This serves as the input/output validation definition.
    @mcp.tool()
    def get_youtube_transcript(url: str) -> str:
        """Get the transcript of a YouTube video"""
  • The @mcp.tool() decorator registers the get_youtube_transcript function as an MCP tool with the FastMCP server instance.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, but offers almost none. It fails to mention external service dependencies (YouTube), rate limits, transcript availability constraints (not all videos have transcripts), or return data format (raw text, JSON, timestamps?).

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 single-sentence description is efficient and front-loaded with the action, containing no filler words. While extremely brief, the deficiency lies in missing information (covered in other dimensions) rather than poor structure or verbosity.

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

Completeness2/5

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

Given zero schema description coverage, no annotations, and no output schema, the description is insufficiently complete. It omits critical context needed for an external-API tool, including parameter details, error conditions (private videos, disabled transcripts), and response structure.

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

Parameters1/5

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

The input schema has 0% description coverage and the 'url' parameter lacks any documentation. The description fails to compensate by not mentioning the parameter at all, leaving users unaware of expected URL format (full URL vs. video ID) or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb ('Get') and resource ('transcript of a YouTube video'), making the tool's function immediately obvious. While it doesn't explicitly contrast with siblings in the description text, the resource target naturally distinguishes it from 'get_channel_info' and 'search_youtube_videos'.

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

Usage Guidelines2/5

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

The description provides no explicit guidance on when to use this tool versus its siblings (e.g., when a user needs captions vs. video metadata) or prerequisites (e.g., ensuring the video has captions enabled). Usage is only implied by the purpose statement.

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/dabidstudio/youtubeinsights-mcp-server'

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