Skip to main content
Glama

play_tiktok_user

Stream TikTok videos from a specific user as an auto-advancing playlist that continuously loads more content as you watch.

Instructions

Play videos from a TikTok user as a continuous auto-advancing playlist. Automatically fetches more videos as you watch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesTikTok username (with or without @)
limitNoInitial batch size (default 15)
shuffleNoShuffle playback order

Implementation Reference

  • The handler function for the 'play_tiktok_user' tool, which fetches videos for a user and launches an MPV playlist.
    async ({ username, limit, shuffle }) => {
      const depErr = checkDeps();
      if (depErr) return errorResult(depErr);
    
      const handle = username.startsWith('@') ? username : `@${username}`;
      const feedUrl = `https://www.tiktok.com/${handle}`;
    
      try {
        const result = await fetchFeed(feedUrl, limit);
        const urls = (result.entries || []).map((e) => e.url as string).filter(Boolean);
        if (urls.length === 0) return textResult('No videos found.');
    
        const playlistFile = mpv.writeTempPlaylist(urls);
        await mpv.launch({ playlistFile, shuffle, socketTimeoutMs: 15_000 });
    
        // Auto-refill: fetch more videos as the playlist runs low
        mpv.startAutoRefill(urls.length, async (offset, batch) => {
          const more = await fetchFeed(feedUrl, batch, offset + 1);
          return (more.entries || []).map((e) => e.url as string).filter(Boolean);
        });
    
        let title = handle;
  • src/index.ts:477-484 (registration)
    The registration of the 'play_tiktok_user' tool using server.tool.
    server.tool(
      'play_tiktok_user',
      'Play videos from a TikTok user as a continuous auto-advancing playlist. Automatically fetches more videos as you watch.',
      {
        username: z.string().describe('TikTok username (with or without @)'),
        limit: z.number().min(1).max(30).default(15).describe('Initial batch size (default 15)'),
        shuffle: z.boolean().default(false).describe('Shuffle playback order'),
      },
Behavior3/5

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

With no annotations provided, the description carries the full disclosure burden. It successfully reveals the streaming/pagination behavior ('fetches more videos as you watch'), but omits other critical behavioral traits such as authentication requirements, error handling for invalid users, side effects on player state, or whether this creates a persistent session.

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. Front-loaded with core action ('Play videos from a TikTok user'), followed immediately by key behavioral differentiator ('auto-advancing'). Every sentence 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?

For a 3-parameter playback tool with 100% schema coverage but no annotations or output schema, the description adequately covers the primary functionality and streaming behavior. Slight gap regarding prerequisites (e.g., TikTok authentication) but sufficient for agent selection.

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 has 100% coverage (baseline 3). The description adds value by contextualizing the 'limit' parameter as an initial batch size within a continuous fetching system ('fetches more videos as you watch'), explaining the pagination behavior that the schema alone doesn't convey.

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?

Specific verb ('Play videos') and resource ('TikTok user') with clear scope differentiation from siblings. The phrases 'continuous auto-advancing playlist' and 'fetches more videos as you watch' distinguish this from get_tiktok_user_videos (retrieval) and play_video (single item).

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 through 'auto-advancing' and 'fetches more videos' which suggests this is for continuous streaming sessions, but lacks explicit when-to-use guidance or named alternatives (e.g., does not explicitly contrast with get_tiktok_user_videos for metadata retrieval vs playback).

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