Skip to main content
Glama

play_video

Play video files locally using FFmpeg, supporting formats like mkv, mp4, mov, and avi. Adjust playback speed and enable loop mode for continuous viewing.

Instructions

使用 ffplay 播放视频文件,支持mkv,mp4,mov,avi,3gp等等

参数:
video_path(str) - 视频文件的路径。
speed(float) - 浮点型,播放速率,建议0.5-2之间。
loop(int) - 整形,是否循环播放,1:不循环,播放后就退出,0: 循环播放。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
loopNo
speedNo
video_pathYes

Implementation Reference

  • MCP tool handler for 'play_video', registered via @mcp.tool() decorator. Delegates execution to cut_video.video_play with parameters.
    @mcp.tool()
    def play_video(video_path, speed = 1, loop = 1):
        """
        使用 ffplay 播放视频文件,支持mkv,mp4,mov,avi,3gp等等
    
        参数:
        video_path(str) - 视频文件的路径。
        speed(float) - 浮点型,播放速率,建议0.5-2之间。
        loop(int) - 整形,是否循环播放,1:不循环,播放后就退出,0: 循环播放。
        """
        return cut_video.video_play(video_path,speed=speed,loop=loop)
  • Core helper function implementing video playback logic using ffplay. Constructs FFplay command with speed adjustment via filters and loop option.
    def video_play(video_path: str, speed, loop):
        speed = float(speed)
        loop = int(loop)
        cmd = f" -loop {loop} "
        if loop != 0:
            cmd = f" {cmd} -autoexit"
        audio_filter_str = ""
        video_filter_str = ""
        if (speed != 1):
            fmt_ctx = ffmpeg.media_format_ctx(video_path)
            if len(fmt_ctx.audio_streams) > 0:
                audio_filter_str = f"-af atempo={speed}"
            if len(fmt_ctx.video_streams) > 0:
                video_filter_str = f"-vf setpts={1/speed}*PTS"
        cmd = f" {cmd } {audio_filter_str} {video_filter_str}   -i {video_path}"
        print(cmd)
        return ffmpeg.run_ffplay(cmd, timeout=60)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool uses ffplay and supports specific formats, but lacks critical details: whether it blocks execution until playback completes, what happens on errors, if it requires specific permissions or system dependencies, or any side effects. The description covers basic functionality but misses important operational context.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by a bulleted list of parameters with explanations. There's minimal waste, though the format list could be slightly trimmed. Structure is clear with purpose first, then parameter details.

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 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is moderately complete. It explains parameters well and states the tool's purpose, but lacks behavioral details (e.g., blocking nature, error handling) and usage context. For a playback tool with no structured metadata, it should provide more operational guidance to be fully adequate.

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 adds meaningful semantics for all three parameters: video_path is explained as the file path, speed as playback rate with suggested range (0.5-2), and loop as integer with clear values (1=no loop, 0=loop). This goes beyond the schema's basic type information, though it could clarify path format or default behaviors more.

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's purpose: '使用 ffplay 播放视频文件' (use ffplay to play video files) with specific resource (video files) and verb (play). It distinguishes from siblings like clip_video or concat_videos by focusing on playback rather than editing or processing. However, it doesn't explicitly contrast with all siblings (e.g., overlay_video might also involve playback).

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. It mentions supported formats (mkv, mp4, etc.) but doesn't explain when to choose play_video over other video-related tools like get_video_info or overlay_video. There's no mention of prerequisites, context, or exclusions for usage.

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

Related 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/video-creator/ffmpeg-mcp'

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