Skip to main content
Glama

queue_video

Add YouTube or TikTok videos to your playback queue without interrupting current playback. If nothing is playing, starts video playback immediately.

Instructions

Add a video to the end of the current playback queue without interrupting what is playing. If nothing is playing, starts playback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesYouTube or TikTok video URL to add to queue

Implementation Reference

  • The registration and implementation handler for the 'queue_video' MCP tool.
    server.tool(
      'queue_video',
      'Add a video to the end of the current playback queue without interrupting what is playing. If nothing is playing, starts playback.',
      {
        url: z.string().url().describe('YouTube or TikTok video URL to add to queue'),
      },
      async ({ url }) => {
        const urlErr = validateVideoUrl(url);
        if (urlErr) return errorResult(urlErr);
        const depErr = checkDeps();
        if (depErr) return errorResult(depErr);
    
        if (!mpv.isPlaying()) {
          try {
            await mpv.launch({ url });
          } catch {
            return errorResult('mpv failed to start.');
          }
          let title = url;
          try { title = (await mpv.getProperty('media-title')) as string || url; } catch { /* loading */ }
          return textResult({ status: 'playing', title, url });
        }
    
        try {
          await mpv.appendUrl(url);
          const count = await mpv.getProperty('playlist-count');
          return textResult({ status: 'queued', url, queuePosition: count });
        } catch (err) {
          return errorResult(`Error: ${err instanceof Error ? err.message : String(err)}`);
        }
      }
    );

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