Skip to main content
Glama

tiktok_sounds

Discover trending TikTok sounds and music for content creation. Retrieve popular audio clips to enhance videos or analyze music trends on the platform.

Instructions

Get trending sounds/music on TikTok.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of sounds (default 20)

Implementation Reference

  • The handler method `get_trending_sounds` which performs the actual scraping of trending sounds from TikTok.
    async def get_trending_sounds(self, count: int = 20) -> list[dict]:
        """Get trending sounds from TikTok."""
        page = await self.goto_tiktok("/music")
        await asyncio.sleep(3)
    
        sounds = []
        scroll_attempts = 0
    
        while len(sounds) < count and scroll_attempts < 10:
            items = await page.evaluate("""() => {
                const sounds = [];
                const cards = document.querySelectorAll('[class*="DivMusicCard"], [class*="music-item"], a[href*="/music/"]');
                cards.forEach(card => {
                    try {
                        const link = card.querySelector('a[href*="/music/"]') || card;
                        const title = card.querySelector('[class*="SpanTitle"]') || card.querySelector('h3') || card;
                        const author = card.querySelector('[class*="SpanAuthor"]') || card.querySelector('p');
                        const uses = card.querySelector('[class*="SpanCount"]');
                        
                        sounds.push({
                            title: title?.textContent?.trim() || '',
                            author: author?.textContent?.trim() || '',
                            url: link?.href || '',
                            uses: uses?.textContent?.trim() || '',
                        });
                    } catch(e) {}
                });
                return sounds;
            }""")
    
            for item in items:
                if item.get("title") and item not in sounds:
                    sounds.append(item)
    
            await page.evaluate("window.scrollBy(0, 600)")
            await asyncio.sleep(random.uniform(1.0, 2.0))
            scroll_attempts += 1
    
        return sounds[:count]
  • Definition of the `tiktok_sounds` tool in the MCP server TOOLS list.
    Tool(
        name="tiktok_sounds",
        description="Get trending sounds/music on TikTok.",
        inputSchema={
            "type": "object",
            "properties": {
                "count": {"type": "integer", "description": "Number of sounds (default 20)", "default": 20},
            },
        },
    ),
  • Tool execution logic for `tiktok_sounds` in `call_tool`.
    elif name == "tiktok_sounds":
        results = await browser.get_trending_sounds(arguments.get("count", 20))
        return [TextContent(type="text", text=json.dumps(results, indent=2, ensure_ascii=False))]
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Get trending sounds/music') but doesn't cover critical aspects like rate limits, authentication needs, data freshness, or what 'trending' means (e.g., time frame, region). This leaves significant gaps for a tool that likely involves external API calls.

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?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose, making it easy for an agent to parse quickly without unnecessary elaboration.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'trending' entails, return format (e.g., list of sound objects with metadata), or error handling. For a tool with no structured behavioral hints, this leaves too much undefined for reliable agent use.

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?

The description adds no parameter-specific information beyond what the schema provides (100% coverage). The schema fully documents the 'count' parameter with type, description, and default. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't need to compensate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('trending sounds/music on TikTok'). It distinguishes itself from siblings like 'tiktok_trending' (likely general trends) and 'tiktok_search' (search functionality), though it doesn't explicitly mention these distinctions.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'tiktok_trending' or 'tiktok_search'. It lacks context about prerequisites, timing, or exclusions, leaving the agent to infer usage based on the name alone.

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/follox42/tiktok-mcp'

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