Skip to main content
Glama

tiktok_analyze_trend

Analyze TikTok trends by searching keywords to identify popular sounds, hashtags, and posting patterns for content strategy.

Instructions

Analyze trends for a niche: search multiple keywords, aggregate stats on popular sounds, hashtags, posting patterns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordsYesKeywords to research
count_per_keywordNoVideos to analyze per keyword (default 10)

Implementation Reference

  • The handler implementation for 'tiktok_analyze_trend', which orchestrates video searches and aggregates hashtag/author statistics.
    elif name == "tiktok_analyze_trend":
        keywords = arguments["keywords"]
        count_per = arguments.get("count_per_keyword", 10)
    
        all_videos = []
        hashtag_counts = {}
        author_counts = {}
        total_engagement = {"likes": 0, "comments": 0, "shares": 0}
    
        for kw in keywords:
            videos = await browser.search_videos(kw, count_per)
            for v in videos:
                all_videos.append(v)
                author = v.get("author", "")
                if author:
                    author_counts[author] = author_counts.get(author, 0) + 1
                desc = v.get("description", "")
                for word in desc.split():
                    if word.startswith("#"):
                        tag = word.lower()
                        hashtag_counts[tag] = hashtag_counts.get(tag, 0) + 1
    
            # Respect rate limit between keywords
            await asyncio.sleep(2)
    
        # Sort hashtags and authors by frequency
        top_hashtags = sorted(hashtag_counts.items(), key=lambda x: -x[1])[:20]
        top_authors = sorted(author_counts.items(), key=lambda x: -x[1])[:10]
    
        analysis = {
            "keywords_analyzed": keywords,
            "total_videos_found": len(all_videos),
            "top_hashtags": [{"hashtag": h, "count": c} for h, c in top_hashtags],
            "top_creators": [{"author": a, "appearances": c} for a, c in top_authors],
            "sample_videos": all_videos[:5],
            "analysis_date": datetime.now().isoformat(),
        }
    
        return [TextContent(type="text", text=json.dumps(analysis, indent=2, ensure_ascii=False))]
  • Tool registration and input schema definition for 'tiktok_analyze_trend'.
    Tool(
        name="tiktok_analyze_trend",
        description="Analyze trends for a niche: search multiple keywords, aggregate stats on popular sounds, hashtags, posting patterns.",
        inputSchema={
            "type": "object",
            "properties": {
                "keywords": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "Keywords to research",
                },
                "count_per_keyword": {
                    "type": "integer",
                    "description": "Videos to analyze per keyword (default 10)",
                    "default": 10,
                },
            },
            "required": ["keywords"],
        },
    ),
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 mentions 'aggregate stats' but doesn't specify what stats are included, how data is sourced (e.g., from recent videos or historical trends), rate limits, or authentication needs. For a tool that likely involves data collection and analysis, this lack of detail leaves key behavioral traits unclear, making it inadequate for informed use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, stating the core purpose in the first clause. It uses a single sentence to outline key actions without unnecessary elaboration. However, it could be slightly more structured by separating the analysis goal from the methods, but overall, it avoids waste and is efficiently phrased.

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 complexity of trend analysis and the absence of annotations and output schema, the description is incomplete. It doesn't explain what the aggregated stats include, how results are formatted, or any limitations (e.g., data recency, accuracy). For a tool with 2 parameters and no structured output, more detail on behavioral aspects and return values is needed to ensure effective 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 input schema has 100% description coverage, clearly documenting both parameters (keywords and count_per_keyword). The description adds minimal value beyond the schema, as it only implies keyword usage without detailing semantics like keyword selection strategies or how count_per_keyword affects analysis depth. Since the schema does the heavy lifting, a baseline score of 3 is appropriate, but the description doesn't compensate with additional insights.

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: 'Analyze trends for a niche' with specific actions like 'search multiple keywords, aggregate stats on popular sounds, hashtags, posting patterns.' It distinguishes itself from siblings like tiktok_search (general search) and tiktok_trending (likely shows trending content) by focusing on analytical aggregation. However, it doesn't explicitly contrast with all siblings, such as tiktok_hashtag or tiktok_sounds, which might overlap in functionality.

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. It mentions analyzing trends for a niche but doesn't specify prerequisites, ideal scenarios, or exclusions. For example, it doesn't clarify if this is for market research, content strategy, or how it differs from tiktok_search or tiktok_trending in practice. Without such context, users must infer usage from the purpose 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