Skip to main content
Glama
FiloHany

Video RAG MCP Server

by FiloHany

show_video_tool

Extract and save specific video segments by specifying document name and timestamp ranges for focused content retrieval.

Instructions

Creates and saves a video chunk based on the document name, start time, and end time of the chunk.
Returns a message indicating that the video chunk was created successfully.

Args:
    document_name (str): The name of the document the chunk belongs to
    start_time (float): The start time of the chunk
    end_time (float): The end time of the chunk

Returns:
    str: A message indicating that the video chunk was created successfully

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_nameYes
start_timeYes
end_timeYes

Implementation Reference

  • server.py:45-63 (handler)
    Handler function for the show_video_tool MCP tool. Registered via @mcp.tool() decorator. Calls the chunk_video helper to create a video clip from the specified document between start_time and end_time, saves it, and returns a success message.
    @mcp.tool()
    def show_video_tool(document_name: str, start_time: float, end_time: float) -> str:
        """
        Creates and saves a video chunk based on the document name, start time, and end time of the chunk.
        Returns a message indicating that the video chunk was created successfully.
    
        Args:
            document_name (str): The name of the document the chunk belongs to
            start_time (float): The start time of the chunk
            end_time (float): The end time of the chunk
    
        Returns:
            str: A message indicating that the video chunk was created successfully
        """
        try:
            chunk_video(document_name, start_time, end_time)
            return "Video chunk created successfully"
        except Exception as e:
            return f"Failed to create video chunk: {str(e)}"
  • Supporting helper function that implements the core video chunking logic using moviepy.VideoFileClip. Loads video from 'videos/{document_name}', extracts subclip from start_time to end_time (clamped to duration), saves as mp4 in 'video_chunks/' directory.
    def chunk_video(document_name, start_time, end_time, directory="videos"):
        # Create output filename
        output_dir = Path("video_chunks")
        output_dir.mkdir(parents=True, exist_ok=True)
    
        chunk_filename = f"video_chunk_{start_time:.1f}_{end_time:.1f}.mp4"
        output_path = output_dir / chunk_filename
    
        with VideoFileClip(directory + "/" + document_name) as video:
            video_duration = video.duration
            actual_end_time = min(end_time, video_duration) if end_time is not None else video_duration
    
            video_chunk = video.subclipped(start_time, actual_end_time)
            video_chunk.write_videofile(str(output_path))
    
        return output_path
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the tool creates and saves a video chunk (implying a write/mutation operation) and returns a success message, which is basic behavioral context. However, it lacks details on permissions, side effects, error handling, or rate limits, leaving significant gaps for a mutation tool.

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 description is well-structured with separate sections for Args and Returns, and each sentence adds value (purpose, parameters, return). It's appropriately sized but could be slightly more front-loaded by moving the purpose statement earlier without the parameter details inline.

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

Completeness3/5

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

Given no annotations, 0% schema coverage, and no output schema, the description provides basic purpose and parameter info but is incomplete. It doesn't cover error cases, output format beyond a string message, or how the video chunk is stored/accessed, which are important for a creation tool.

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 description coverage is 0%, so the description must compensate. It explicitly documents all three parameters (document_name, start_time, end_time) with brief semantics, adding meaningful context beyond the bare schema. However, it doesn't specify units for times (e.g., seconds) or document name format, leaving some ambiguity.

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 tool 'creates and saves a video chunk' with specific resources (document name, start time, end time), providing a concrete verb+resource combination. However, it doesn't distinguish from sibling tools (ingest_data_tool, retrieve_data_tool) which appear to handle different operations, so it misses full differentiation.

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?

No guidance is provided on when to use this tool versus alternatives like ingest_data_tool or retrieve_data_tool. The description mentions creating video chunks but doesn't specify prerequisites, constraints, or when-not-to-use scenarios, leaving usage context implied at best.

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/FiloHany/Video_RAG_MCP'

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