Skip to main content
Glama

compare_periods

Compare news trends between two periods to identify hot topic changes, platform activity shifts, and news volume differences. Choose overview, topic shift, or platform activity analysis.

Instructions

时期对比分析 - 比较两个时间段的新闻数据

对比不同时期的热点话题、平台活跃度、新闻数量等维度。

使用场景:

  • 对比本周和上周的热点变化

  • 分析某个话题在两个时期的热度差异

  • 查看各平台活跃度的周期性变化

Args: period1: 第一个时间段(基准期) - {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}: 日期范围 - "today", "yesterday", "this_week", "last_week", "this_month", "last_month": 预设值 period2: 第二个时间段(对比期,格式同 period1) topic: 可选的话题关键词(聚焦特定话题的对比) compare_type: 对比类型 - "overview": 总体概览(默认)- 新闻数量、关键词变化、TOP新闻 - "topic_shift": 话题变化分析 - 上升话题、下降话题、新出现话题 - "platform_activity": 平台活跃度对比 - 各平台新闻数量变化 platforms: 平台过滤列表,如 ['zhihu', 'weibo'] top_n: 返回 TOP N 结果,默认10

Returns: JSON格式的对比分析结果,包含: - periods: 两个时期的日期范围 - compare_type: 对比类型 - overview/topic_shift/platform_comparison: 具体对比结果(根据类型)

Examples: - compare_periods(period1="last_week", period2="this_week") # 周环比 - compare_periods(period1="last_month", period2="this_month", compare_type="topic_shift") - compare_periods( period1={"start": "2025-01-01", "end": "2025-01-07"}, period2={"start": "2025-01-08", "end": "2025-01-14"}, topic="人工智能" )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNo
topicNo
period1Yes
period2Yes
platformsNo
compare_typeNooverview

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden. It clearly states that the tool performs a comparison and returns a JSON result with specific fields (periods, compare_type, and result object based on type). It also describes the parameter effects (e.g., compare_type changes the output shape). While it does not explicitly state that it is read-only or non-destructive, the nature of a comparison analysis tool implicitly conveys this. It omits potential performance or error considerations, but the behavior is well described for typical usage.

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 well-structured and dense. It opens with a one-line summary, then usage scenarios, followed by a clear Args block with per-parameter explanations, a Returns section, and examples. Each sentence adds value—no filler. The format is front-loaded with the purpose and usage, and the parameter details are organized in a readable list. This is efficient and easy for an agent to parse.

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 (6 params, no enum constraints, no schema descriptions) and the presence of an output schema (though not shown, the description details the return structure), the description is complete. It covers all parameter formats, defaults, and the output JSON structure, and provides three illustrative examples that cover the main comparison types. An agent can call this tool correctly without external documentation.

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?

The schema provides zero description coverage (0%), so the description must fully elaborate on parameter semantics, and it does. It explains period1 and period2 with two formats (object with start/end dates and preset strings like 'today'/'last_week'), lists valid compare_type values with meanings, describes topic as an optional filter, platforms as a list, and top_n with default. It also includes examples that demonstrate parameter combinations. This surpasses the schema's bare type definitions and provides complete guidance.

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

Purpose5/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: comparing two periods of news data ('时期对比分析 - 比较两个时间段的新闻数据'). It specifies the resource (news data) and the action (comparison), and enumerates comparison dimensions (hot topics, platform activity, news volume). This clearly distinguishes it from sibling tools like analyze_topic_trend (single-period trend) and search_news (search), making the purpose unambiguous.

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 explicit usage scenarios (comparing week-over-week hotspot changes, analyzing topic popularity differences across periods, viewing periodic platform activity changes) and three concrete examples that illustrate typical calls. However, it does not explicitly state when NOT to use this tool or name alternative tools for different tasks (e.g., using analyze_topic_trend for a single-period trend). Despite this, the scenarios are clear enough for an agent to decide when this tool is appropriate.

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/AY08siliang/TrendRadar'

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