Skip to main content
Glama

get_summary

Generate summaries of YouTube videos in multiple languages and lengths to quickly understand video content without watching the full video.

Instructions

Generate a summary of a YouTube video

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
languageNoen
lengthNomedium

Implementation Reference

  • Registration of the 'get_summary' tool using the MCP server decorator.
    @mcp_server.tool(name="get_summary", description="Generate a summary of a YouTube video")
  • The main handler function for the 'get_summary' tool. It validates inputs, processes the YouTube video URL to get a video ID, calls the YouTube Translate API to fetch the summary, handles errors, and returns the summary text.
    async def get_summary(url: str, language: str = "en", length: str = "medium") -> str:
        """Generate a summary of a YouTube video.
    
        This tool processes a video and generates a summary of its content in the specified language.
        It properly handles "processing" states by polling until completion rather than failing immediately.
        If the requested language is not available, it automatically requests a translation first.
    
        Args:
            url: The YouTube video URL
            language: Language code for the summary (e.g., "en", "fr")
            length: Length of the summary ("short", "medium", or "long")
            
        Returns:
            A summary of the video content
        """
        logger.info(f"Getting summary for URL: {url}, language: {language}, length: {length}")
        
        # Validate length
        if length not in ["short", "medium", "long"]:
            error_msg = f"Invalid length: {length}. Must be 'short', 'medium', or 'long'."
            logger.error(error_msg)
            return f"Error: {error_msg}"
        
        # Process the video to ensure it's ready
        success, video_id, error_message = await process_video(url)
        
        if not success:
            logger.error(f"Failed to process video: {error_message}")
            return f"Error: {error_message}"
        
        # Get the summary from the API
        summary_response = await make_yt_api_request(
            f"/api/videos/{video_id}/summary",
            params={"language": language, "length": length}
        )
        
        if not summary_response:
            error_msg = f"Failed to retrieve summary for language: {language}, length: {length}"
            logger.error(error_msg)
            return f"Error: {error_msg}"
        
        # Check if the response is a JSON object with the summary
        if isinstance(summary_response, dict) and "summary" in summary_response:
            return summary_response["summary"]
        elif isinstance(summary_response, dict) and "error" in summary_response:
            error_msg = summary_response["error"]
            logger.error(f"API error: {error_msg}")
            return f"Error: {error_msg}"
        else:
            error_msg = "Unexpected response format from API."
            logger.error(error_msg)
            return f"Error: {error_msg}"
  • Input schema defined by function parameters: url (str, required), language (str, default 'en'), length (str, default 'medium'). Output: str (the summary).
    async def get_summary(url: str, language: str = "en", length: str = "medium") -> str:
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. It mentions 'Generate a summary' but doesn't explain what that entails—e.g., whether it's AI-generated, based on transcripts, or includes key points. It also lacks details on rate limits, authentication needs, or output format, leaving significant gaps in understanding how the tool behaves.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to grasp quickly, though this brevity contributes to gaps in other dimensions.

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 the complexity of summarizing a YouTube video, no annotations, no output schema, and 3 parameters with 0% schema description coverage, the description is incomplete. It doesn't address how the summary is generated, what the output looks like, or any behavioral traits, leaving the agent with insufficient context to use the tool effectively.

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

Parameters3/5

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

The description adds no parameter semantics beyond what the input schema provides, as it doesn't mention any parameters. With 0% schema description coverage and 3 parameters (url, language, length), the schema alone documents them minimally via titles and defaults. The baseline is 3 because the schema handles parameter definition, but the description fails to compensate for the low coverage by explaining what 'length' or 'language' mean in context.

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 clearly states the action ('Generate a summary') and resource ('of a YouTube video'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_subtitles' or 'get_transcript', which also process YouTube videos but for different outputs, leaving room for confusion about when to choose this specific tool.

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 guidance on when to use this tool versus alternatives like 'get_subtitles' or 'get_transcript', nor does it mention prerequisites or exclusions. It simply states what the tool does without context for selection among similar tools.

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/brianshin22/youtube-translate-mcp'

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