Skip to main content
Glama
funinii

TrendRadar

by funinii

search_news

Search news articles across multiple platforms using keyword, fuzzy, or entity matching modes with date filtering and customizable sorting options.

Instructions

统一搜索接口,支持多种搜索模式

重要:日期范围处理 当用户使用"本周"、"最近7天"等自然语言时,请先调用 resolve_date_range 工具获取精确日期:

  1. 调用 resolve_date_range("本周") → 获取 {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}

  2. 将返回的 date_range 传入本工具

Args: query: 搜索关键词或内容片段 search_mode: 搜索模式,可选值: - "keyword": 精确关键词匹配(默认,适合搜索特定话题) - "fuzzy": 模糊内容匹配(适合搜索内容片段,会过滤相似度低于阈值的结果) - "entity": 实体名称搜索(适合搜索人物/地点/机构) date_range: 日期范围(可选) - 格式: {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"} - 获取方式: 调用 resolve_date_range 工具解析自然语言日期 - 默认: 不指定时默认查询今天的新闻 platforms: 平台ID列表,如 ['zhihu', 'weibo', 'douyin'] - 不指定时:使用 config.yaml 中配置的所有平台 - 支持的平台来自 config/config.yaml 的 platforms 配置 - 每个平台都有对应的name字段(如"知乎"、"微博"),方便AI识别 limit: 返回条数限制,默认50,最大1000 注意:实际返回数量取决于搜索匹配结果(特别是 fuzzy 模式下会过滤低相似度结果) sort_by: 排序方式,可选值: - "relevance": 按相关度排序(默认) - "weight": 按新闻权重排序 - "date": 按日期排序 threshold: 相似度阈值(仅fuzzy模式有效),0-1之间,默认0.6 注意:阈值越高匹配越严格,返回结果越少 include_url: 是否包含URL链接,默认False(节省token)

Returns: JSON格式的搜索结果,包含标题、平台、排名等信息

Examples: 用户:"搜索本周的AI新闻" 推荐调用流程: 1. resolve_date_range("本周") → {"date_range": {"start": "2025-11-18", "end": "2025-11-26"}} 2. search_news(query="AI", date_range={"start": "2025-11-18", "end": "2025-11-26"})

用户:"最近7天的特斯拉新闻"
推荐调用流程:
1. resolve_date_range("最近7天") → {"date_range": {"start": "2025-11-20", "end": "2025-11-26"}}
2. search_news(query="特斯拉", date_range={"start": "2025-11-20", "end": "2025-11-26"})

用户:"今天的AI新闻"(默认今天,无需解析)
→ search_news(query="AI")

重要:数据展示策略

  • 本工具返回完整的搜索结果列表

  • 默认展示方式:展示全部返回的新闻,无需总结或筛选

  • 仅在用户明确要求"总结"或"挑重点"时才进行筛选

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
search_modeNokeyword
date_rangeNo
platformsNo
limitNo
sort_byNorelevance
thresholdNo
include_urlNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'search_news' tool handler defined in the MCP server. It acts as an entry point and calls 'search_news_unified' from the search tools.
    async def search_news(
        query: str,
        search_mode: str = "keyword",
        date_range: Optional[Dict[str, str]] = None,
        platforms: Optional[List[str]] = None,
        limit: int = 50,
        sort_by: str = "relevance",
        threshold: float = 0.6,
        include_url: bool = False
    ) -> str:
        """
        统一搜索接口,支持多种搜索模式
    
        **重要:日期范围处理**
        当用户使用"本周"、"最近7天"等自然语言时,请先调用 resolve_date_range 工具获取精确日期:
        1. 调用 resolve_date_range("本周") → 获取 {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}
        2. 将返回的 date_range 传入本工具
  • The actual implementation of 'search_news_unified', which handles the logic for various search modes like keyword, fuzzy, and entity search.
    def search_news_unified(
        self,
        query: str,
        search_mode: str = "keyword",
        date_range: Optional[Dict[str, str]] = None,
        platforms: Optional[List[str]] = None,
        limit: int = 50,
        sort_by: str = "relevance",
        threshold: float = 0.6,
        include_url: bool = False
    ) -> Dict:
        """
        统一新闻搜索工具 - 整合多种搜索模式
    
        Args:
            query: 查询内容(必需)- 关键词、内容片段或实体名称
            search_mode: 搜索模式,可选值:
                - "keyword": 精确关键词匹配(默认)
                - "fuzzy": 模糊内容匹配(使用相似度算法)
                - "entity": 实体名称搜索(自动按权重排序)
            date_range: 日期范围(可选)
                       - **格式**: {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}
                       - **示例**: {"start": "2025-01-01", "end": "2025-01-07"}
                       - **默认**: 不指定时默认查询今天
                       - **注意**: start和end可以相同(表示单日查询)
            platforms: 平台过滤列表,如 ['zhihu', 'weibo']
            limit: 返回条数限制,默认50
            sort_by: 排序方式,可选值:
                - "relevance": 按相关度排序(默认)
                - "weight": 按新闻权重排序
                - "date": 按日期排序
            threshold: 相似度阈值(仅fuzzy模式有效),0-1之间,默认0.6
            include_url: 是否包含URL链接,默认False(节省token)
    
        Returns:
            搜索结果字典,包含匹配的新闻列表
Behavior5/5

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

With no annotations provided, the description carries full burden and does so comprehensively. It discloses important behavioral traits: the need to pre-process natural language dates via another tool, default behaviors (today's news when no date_range, all platforms when none specified), result filtering in fuzzy mode, token-saving considerations with include_url, and data display strategies (default to show all results).

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 (important notes, args, returns, examples, data strategy) but is quite lengthy. While every section adds value, some information could potentially be more concise. The front-loading of the date range processing requirement is excellent.

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

Completeness5/5

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

Given the tool's complexity (8 parameters, no annotations, 0% schema coverage) and the presence of an output schema, the description is remarkably complete. It covers purpose, usage guidelines, parameter semantics, behavioral traits, examples, and data handling strategies. The output schema handles return values, so the description appropriately focuses on usage context.

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 and 8 parameters, the description provides extensive semantic information beyond the bare schema. It explains each parameter's purpose, valid values, defaults, interactions (threshold only for fuzzy mode), and practical usage examples. The description fully compensates for the schema's lack of descriptions.

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 as a 'unified search interface supporting multiple search modes' for news, which is specific (verb+resource). However, it doesn't explicitly differentiate from sibling tools like 'get_latest_news', 'get_news_by_date', or 'search_related_news_history', which appear to be related news retrieval tools.

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

Usage Guidelines5/5

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

The description provides excellent usage guidance, including explicit instructions for when to use the resolve_date_range tool first ('本周', '最近7天'), when to use different search modes, default behaviors, and data display strategies. It also mentions config.yaml configuration for platforms.

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