Skip to main content
Glama
funinii

TrendRadar

by funinii

analyze_data_insights

Analyze platform comparisons, activity statistics, and keyword co-occurrence patterns to extract actionable insights from aggregated trend data.

Instructions

统一数据洞察分析工具 - 整合多种数据分析模式

Args: insight_type: 洞察类型,可选值: - "platform_compare": 平台对比分析(对比不同平台对话题的关注度) - "platform_activity": 平台活跃度统计(统计各平台发布频率和活跃时间) - "keyword_cooccur": 关键词共现分析(分析关键词同时出现的模式) topic: 话题关键词(可选,platform_compare模式适用) date_range: 【对象类型】 日期范围(可选) - 格式: {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"} - 示例: {"start": "2025-01-01", "end": "2025-01-07"} - 重要: 必须是对象格式,不能传递整数 min_frequency: 最小共现频次(keyword_cooccur模式),默认3 top_n: 返回TOP N结果(keyword_cooccur模式),默认20

Returns: JSON格式的数据洞察分析结果

Examples: - analyze_data_insights(insight_type="platform_compare", topic="人工智能") - analyze_data_insights(insight_type="platform_activity", date_range={"start": "2025-01-01", "end": "2025-01-07"}) - analyze_data_insights(insight_type="keyword_cooccur", min_frequency=5, top_n=15)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
insight_typeNoplatform_compare
topicNo
date_rangeNo
min_frequencyNo
top_nNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The implementation of `analyze_data_insights_unified` (called by `analyze_data_insights` in `server.py`) which acts as the main handler for "analyze_data_insights" tool. It routes requests to `compare_platforms`, `get_platform_activity_stats`, or `analyze_keyword_cooccurrence`.
    def analyze_data_insights_unified(
        self,
        insight_type: str = "platform_compare",
        topic: Optional[str] = None,
        date_range: Optional[Dict[str, str]] = None,
        min_frequency: int = 3,
        top_n: int = 20
    ) -> Dict:
        """
        统一数据洞察分析工具 - 整合多种数据分析模式
    
        Args:
            insight_type: 洞察类型,可选值:
                - "platform_compare": 平台对比分析(对比不同平台对话题的关注度)
                - "platform_activity": 平台活跃度统计(统计各平台发布频率和活跃时间)
                - "keyword_cooccur": 关键词共现分析(分析关键词同时出现的模式)
            topic: 话题关键词(可选,platform_compare模式适用)
            date_range: 日期范围,格式: {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}
            min_frequency: 最小共现频次(keyword_cooccur模式),默认3
            top_n: 返回TOP N结果(keyword_cooccur模式),默认20
    
        Returns:
            数据洞察分析结果字典
    
        Examples:
            - analyze_data_insights_unified(insight_type="platform_compare", topic="人工智能")
            - analyze_data_insights_unified(insight_type="platform_activity", date_range={...})
            - analyze_data_insights_unified(insight_type="keyword_cooccur", min_frequency=5)
        """
        try:
            # 参数验证
            if insight_type not in ["platform_compare", "platform_activity", "keyword_cooccur"]:
                raise InvalidParameterError(
                    f"无效的洞察类型: {insight_type}",
                    suggestion="支持的类型: platform_compare, platform_activity, keyword_cooccur"
                )
    
            # 根据洞察类型调用相应方法
            if insight_type == "platform_compare":
                return self.compare_platforms(
                    topic=topic,
                    date_range=date_range
                )
            elif insight_type == "platform_activity":
                return self.get_platform_activity_stats(
                    date_range=date_range
                )
            else:  # keyword_cooccur
                return self.analyze_keyword_cooccurrence(
                    min_frequency=min_frequency,
                    top_n=top_n
                )
  • The MCP tool registration for `analyze_data_insights`. This function acts as an entry point in `server.py` and calls `tools['analytics'].analyze_data_insights_unified`.
    @mcp.tool
    async def analyze_data_insights(
        insight_type: str = "platform_compare",
        topic: Optional[str] = None,
        date_range: Optional[Dict[str, str]] = None,
        min_frequency: int = 3,
        top_n: int = 20
    ) -> str:
        """
        统一数据洞察分析工具 - 整合多种数据分析模式
    
        Args:
            insight_type: 洞察类型,可选值:
                - "platform_compare": 平台对比分析(对比不同平台对话题的关注度)
                - "platform_activity": 平台活跃度统计(统计各平台发布频率和活跃时间)
                - "keyword_cooccur": 关键词共现分析(分析关键词同时出现的模式)
            topic: 话题关键词(可选,platform_compare模式适用)
            date_range: **【对象类型】** 日期范围(可选)
                        - **格式**: {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}
                        - **示例**: {"start": "2025-01-01", "end": "2025-01-07"}
                        - **重要**: 必须是对象格式,不能传递整数
            min_frequency: 最小共现频次(keyword_cooccur模式),默认3
            top_n: 返回TOP N结果(keyword_cooccur模式),默认20
    
        Returns:
            JSON格式的数据洞察分析结果
    
        Examples:
            - analyze_data_insights(insight_type="platform_compare", topic="人工智能")
            - analyze_data_insights(insight_type="platform_activity", date_range={"start": "2025-01-01", "end": "2025-01-07"})
            - analyze_data_insights(insight_type="keyword_cooccur", min_frequency=5, top_n=15)
        """
        tools = _get_tools()
        result = tools['analytics'].analyze_data_insights_unified(
            insight_type=insight_type,
            topic=topic,
            date_range=date_range,
            min_frequency=min_frequency,
            top_n=top_n
        )
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that returns are 'JSON format data insights analysis results' and provides important behavioral notes like date_range 'must be object format, cannot pass integer'. However, it doesn't mention rate limits, authentication requirements, data freshness, or whether this is a read-only vs. write operation. The description adds some behavioral context but leaves significant gaps.

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 well-structured with clear sections (Args, Returns, Examples) and uses bullet points effectively. While somewhat lengthy due to detailed parameter explanations, every sentence earns its place by providing necessary information. The front-loaded statement establishes the tool's purpose immediately.

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 5 parameters with 0% schema coverage and no annotations, the description does an excellent job explaining parameters and providing usage examples. The presence of an output schema means the description doesn't need to detail return values. However, for a complex analytical tool with multiple modes, more behavioral context about performance, data sources, or limitations would be beneficial.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing comprehensive parameter documentation. It explains each parameter's purpose, valid values for insight_type, when parameters apply to specific modes, format requirements for date_range with examples, and default values for min_frequency and top_n. This adds substantial meaning beyond the bare schema.

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 this is a 'unified data insights analysis tool' that 'integrates multiple data analysis modes', with specific examples of insight types like platform comparison and keyword co-occurrence. It distinguishes itself from siblings by focusing on analytical insights rather than sentiment analysis, topic trends, or news retrieval. However, it doesn't explicitly contrast with all sibling tools like 'generate_summary_report' which might overlap.

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 context for when to use each insight_type mode, with examples showing appropriate parameter combinations. It explains that 'topic' is optional but applicable to 'platform_compare' mode, and 'date_range' is optional but shown in examples. However, it doesn't explicitly state when NOT to use this tool versus alternatives like 'analyze_topic_trend' or 'get_trending_topics' among the 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/funinii/TrendRadar'

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