Skip to main content
Glama
Talhelf
by Talhelf

compare_performers

Compare Google search trends for adult performers to analyze relative popularity and search interest over specified time periods and regions.

Instructions

Compare Google search trends between different performers.

Args:
    performer_names: List of performer names to compare (max 5)
                    Example: ["Lana Rhoades", "Riley Reid", "Abella Danger"]
    timeframe: Time period (default: past 12 months)
               Use 'today 5-y' for 5 year comparison
               Use '2020-01-01 2024-12-31' for custom range
    region: Region code (default: US)

Returns:
    Comparative analysis showing which performer has higher search interest.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
performer_namesYes
timeframeNotoday 12-m
regionNoUS

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main implementation of compare_performers tool. Validates performer names (2-5 required), accepts timeframe and region parameters, and delegates to search_trends for the actual data fetching and formatting.
    @mcp.tool()
    async def compare_performers(
        performer_names: list[str],
        timeframe: str = "today 12-m",
        region: str = "US"
    ) -> str:
        """
        Compare Google search trends between different performers.
        
        Args:
            performer_names: List of performer names to compare (max 5)
                            Example: ["Lana Rhoades", "Riley Reid", "Abella Danger"]
            timeframe: Time period (default: past 12 months)
                       Use 'today 5-y' for 5 year comparison
                       Use '2020-01-01 2024-12-31' for custom range
            region: Region code (default: US)
        
        Returns:
            Comparative analysis showing which performer has higher search interest.
        """
        
        if len(performer_names) > 5:
            return "⚠️  Maximum 5 performers can be compared at once."
        
        if len(performer_names) < 2:
            return "⚠️  Please provide at least 2 performers to compare."
        
        return await search_trends(performer_names, timeframe, region)
  • The search_trends function that compare_performers delegates to. Handles keyword validation, calls get_trends_data, and formats results using helper functions for interest over time, regional data, and related queries.
    @mcp.tool()
    async def search_trends(
        keywords: list[str],
        timeframe: str = "today 12-m",
        region: str = "US"
    ) -> str:
        """
        Search Google Trends for any keywords (performers, platforms, categories, etc.).
        
        Args:
            keywords: List of search terms to analyze (max 5). Examples:
                      ["Lana Rhoades", "Riley Reid"]
                      ["pornhub", "onlyfans"]
                      ["milf", "teen", "amateur"]
            timeframe: Time period. Options:
                       'today 12-m' (past year, default)
                       'today 3-m' (past 3 months)
                       'today 5-y' (past 5 years)
                       '2020-01-01 2024-12-31' (custom date range)
                       Available back to 2004
            region: Geographic region code:
                    'US' (USA, default)
                    'GB' (UK)
                    '' (Worldwide)
                    Any ISO country code
        
        Returns:
            Complete Google Trends analysis with interest over time, regional data, and related queries.
        """
        
        if not pytrends:
            return "❌ Google Trends API is not available. Please check configuration."
        
        if len(keywords) > 5:
            return "⚠️  Maximum 5 keywords allowed per query. Please reduce your list."
        
        if len(keywords) == 0:
            return "⚠️  Please provide at least one keyword to search."
        
        # Fetch data
        data = get_trends_data(keywords, timeframe, region)
        
        # Format and return results
        result = [
            format_interest_over_time(data),
            "",
            format_regional_interest(data, top_n=10),
            format_related_queries(data),
            "",
            "📝 Notes:",
            "- Values are on a 0-100 scale where 100 = peak popularity for the time period",
            "- Data represents search interest, not absolute search volumes",
            f"- Data fetched: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}"
        ]
        
        return "\n".join(result)
  • Core data fetching function that interacts with Google Trends API (pytrends). Implements caching (1 hour), rate limiting, and retrieves interest over time, regional data, and related queries for the given keywords.
    def get_trends_data(keywords: list[str], timeframe: str = 'today 12-m', geo: str = 'US') -> dict:
        """
        Fetch Google Trends data for given keywords.
        
        Args:
            keywords: List of search terms to compare (max 5)
            timeframe: Time period (e.g., 'today 12-m', 'today 5-y', '2020-01-01 2024-12-31')
            geo: Geographic region (e.g., 'US', 'GB', '' for worldwide)
        
        Returns:
            Dictionary with trends data
        """
        if not pytrends:
            return {"error": "Google Trends API not available"}
        
        # Check cache
        cache_key = f"{','.join(keywords)}_{timeframe}_{geo}"
        if cache_key in TRENDS_CACHE:
            cached = TRENDS_CACHE[cache_key]
            age = (datetime.now() - datetime.fromisoformat(cached['fetched_at'])).seconds
            if age < 3600:  # Cache for 1 hour
                print(f"Using cached data (age: {age}s)", file=sys.stderr)
                return cached
        
        try:
            print(f"Fetching Google Trends: {keywords}, {timeframe}, {geo}", file=sys.stderr)
            
            # Build payload
            pytrends.build_payload(keywords, cat=0, timeframe=timeframe, geo=geo, gprop='')
            
            # Get interest over time
            interest_over_time_df = pytrends.interest_over_time()
            
            # Get interest by region
            try:
                interest_by_region_df = pytrends.interest_by_region(resolution='REGION', inc_low_vol=True, inc_geo_code=False)
            except Exception as e:
                print(f"Could not fetch regional data: {e}", file=sys.stderr)
                interest_by_region_df = pd.DataFrame()
            
            # Get related queries
            try:
                related_queries = pytrends.related_queries()
            except Exception as e:
                print(f"Could not fetch related queries: {e}", file=sys.stderr)
                related_queries = {}
            
            result = {
                "keywords": keywords,
                "timeframe": timeframe,
                "geo": geo,
                "interest_over_time": interest_over_time_df.to_dict() if not interest_over_time_df.empty else {},
                "interest_by_region": interest_by_region_df.to_dict() if not interest_by_region_df.empty else {},
                "related_queries": related_queries,
                "fetched_at": datetime.now().isoformat()
            }
            
            # Cache the result
            TRENDS_CACHE[cache_key] = result
            
            # Rate limiting
            time.sleep(1)
            
            return result
            
        except Exception as e:
            print(f"Error fetching Google Trends data: {e}", file=sys.stderr)
            return {"error": str(e)}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool returns a 'comparative analysis showing which performer has higher search interest,' which gives some output context. However, it lacks details on rate limits, authentication needs, data freshness, or error handling. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 efficiently structured with clear sections: purpose statement, parameter explanations with examples, and return value description. Every sentence adds value without redundancy. It's appropriately sized and front-loaded with the core functionality.

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 moderate complexity (3 parameters, no annotations, but with an output schema), the description is reasonably complete. It covers parameter semantics thoroughly, states the purpose clearly, and mentions the return value. The output schema likely details the 'comparative analysis,' so the description doesn't need to explain return values further. Minor gaps include lack of behavioral context and usage guidelines.

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?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains each parameter: 'performer_names' as a list with a max of 5 and an example, 'timeframe' with default and format examples, and 'region' with default. This compensates well for the schema's lack of descriptions, though it doesn't cover all possible edge cases.

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: 'Compare Google search trends between different performers.' This specifies the verb ('compare'), resource ('Google search trends'), and target ('performers'). It distinguishes from siblings like 'analyze_category_trends' or 'compare_platforms' by focusing specifically on performers, though it doesn't explicitly contrast with them.

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. While it implicitly suggests use for comparing performer search trends, it doesn't mention when to choose this over siblings like 'search_trends' or 'historical_analysis', nor does it specify prerequisites or exclusions. Usage context is implied but not explicit.

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/Talhelf/ph-mcp'

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