Skip to main content
Glama

play_audio

Play audio from YouTube or TikTok videos without the video window. Use for podcasts, music, or background listening while working on other tasks.

Instructions

Play audio only from a YouTube or TikTok video — no video window. Perfect for podcasts, music, and long-form content while you code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesYouTube or TikTok video URL
timestampNoStart position in seconds

Implementation Reference

  • The play_audio tool handler, which validates the URL and dependencies before launching the MPV process in audio-only mode.
    server.tool(
      'play_audio',
      'Play audio only from a YouTube or TikTok video — no video window. Perfect for podcasts, music, and long-form content while you code.',
      {
        url: z.string().url().describe('YouTube or TikTok video URL'),
        timestamp: z.number().min(0).optional().describe('Start position in seconds'),
      },
      async ({ url, timestamp }) => {
        const urlErr = validateVideoUrl(url);
        if (urlErr) return errorResult(urlErr);
        const depErr = checkDeps();
        if (depErr) return errorResult(depErr);
    
        try {
          await mpv.launch({ url, timestamp, audioOnly: true });
        } 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_audio', title, url, ...(timestamp ? { startedAt: `${timestamp}s` } : {}) });
      }
    );
Behavior3/5

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

With no annotations provided, the description must carry the full burden of behavioral disclosure. It successfully conveys the audio-only nature and platform support (YouTube/TikTok), but omits operational details such as browser session requirements (relevant given get_browser/set_browser siblings), error handling for invalid URLs, or state persistence.

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?

Two sentences with zero waste. The first sentence front-loads the core functionality and key differentiator (audio-only, no window), while the second provides use-case context. Every word earns its place.

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?

Given the tool's simplicity (2 primitive parameters, no output schema, no annotations), the description adequately covers user-facing behavior. It could be improved by noting browser context requirements implied by sibling tools, but the core contract is sufficiently documented for invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both parameters (url and timestamp). The description reinforces the URL constraints by mentioning 'YouTube or TikTok,' but does not add semantic meaning to the timestamp parameter beyond what the schema already provides ('Start position in seconds'). Baseline 3 is appropriate given comprehensive schema coverage.

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?

The description provides a specific verb ('Play'), identifies the resource ('audio from a YouTube or TikTok video'), and clearly distinguishes this from video-playing siblings with the explicit constraint 'no video window.' The differentiation is sharp and actionable.

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

Usage Guidelines4/5

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

The description provides clear use-case guidance ('Perfect for podcasts, music, and long-form content while you code'), implicitly contrasting with play_video (visual content) and play_shorts (short-form). While it doesn't explicitly name alternatives to avoid, the context strongly signals when to select this over siblings.

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