Skip to main content
Glama

play_video

Play YouTube or TikTok videos in a lightweight mpv player. Start at specific timestamps or use audio-only mode for podcasts and music while working.

Instructions

Play a video from YouTube or TikTok in a lightweight mpv player window. Optionally start at a specific timestamp. Set audio_only to true for audio-only playback (great for podcasts/music while coding).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesYouTube or TikTok video URL
timestampNoStart position in seconds
audio_onlyNoAudio-only mode — no video window, just audio

Implementation Reference

  • Implementation of the 'play_video' tool, which handles validation, calls mpv.launch, and returns the playback status.
    server.tool(
      'play_video',
      'Play a video from YouTube or TikTok in a lightweight mpv player window. Optionally start at a specific timestamp. Set audio_only to true for audio-only playback (great for podcasts/music while coding).',
      {
        url: z.string().url().describe('YouTube or TikTok video URL'),
        timestamp: z.number().min(0).optional().describe('Start position in seconds'),
        audio_only: z.boolean().default(false).describe('Audio-only mode — no video window, just audio'),
      },
      async ({ url, timestamp, audio_only }) => {
        const urlErr = validateVideoUrl(url);
        if (urlErr) return errorResult(urlErr);
        const depErr = checkDeps();
        if (depErr) return errorResult(depErr);
    
        try {
          await mpv.launch({ url, timestamp, audioOnly: audio_only });
        } catch {
          return errorResult('mpv failed to start. Run `mpv <url>` manually to see the error.');
        }
    
        let title = url;
        try { title = (await mpv.getProperty('media-title')) as string || url; } catch { /* loading */ }
    
        return textResult({ status: 'playing', title, url, audioOnly: audio_only, ...(timestamp ? { startedAt: `${timestamp}s` } : {}) });
      }
    );
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses player implementation (mpv window) and audio-only behavior (no video window). However, fails to specify interaction with current playback (does it stop existing video? queue? error?), or behavior when called while another video plays, which is critical given siblings like stop_video and queue_video exist.

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?

Three sentences with zero waste. Front-loaded with core action (Play video...), followed by optional features (timestamp, audio_only). Every sentence earns its place; no redundant phrases or filler.

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

Completeness4/5

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

Appropriately complete for a 3-parameter media tool with no output schema. Covers main action, all parameters, and primary use cases. Minor gap: could clarify relationship to queue_video (immediate playback vs queuing) given sibling context, but sufficient for correct invocation.

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 coverage is 100%, establishing baseline of 3. Description adds valuable usage context beyond schema: 'lightweight mpv player window' clarifies delivery mechanism not in schema, and 'great for podcasts/music while coding' provides use-case guidance for audio_only that raw schema lacks.

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?

States specific action (Play) + resource (video from YouTube or TikTok) + implementation (lightweight mpv player window). Distinguishes from sibling play_audio by focusing on video playback with optional audio-only mode, and from get_video_info by emphasizing playback action.

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

Usage Guidelines3/5

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

Provides implied usage guidance for audio_only parameter ('great for podcasts/music while coding'), suggesting when to use that specific mode. However, lacks explicit comparison to sibling play_audio or guidance on when to use play_video vs. queue_video, despite both existing in the tool set.

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/ronantakizawa/social-video-mcp'

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