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
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | YouTube or TikTok video URL to add to queue |
Implementation Reference
- src/index.ts:518-549 (handler)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)}`); } } );