获取关注词配置 返回 frequency_words.txt 中配置的关注词分组。
()
| 97 | |
| 98 | @mcp.resource("config://keywords") |
| 99 | async def get_keywords_resource() -> str: |
| 100 | """ |
| 101 | 获取关注词配置 |
| 102 | |
| 103 | 返回 frequency_words.txt 中配置的关注词分组。 |
| 104 | """ |
| 105 | tools = _get_tools() |
| 106 | config = await asyncio.to_thread( |
| 107 | tools['config'].get_current_config, section="keywords" |
| 108 | ) |
| 109 | return json.dumps({ |
| 110 | "word_groups": config.get("word_groups", []), |
| 111 | "total_groups": config.get("total_groups", 0), |
| 112 | "description": "TrendRadar 关注词配置" |
| 113 | }, ensure_ascii=False, indent=2) |
| 114 | |
| 115 | |
| 116 | # ==================== 日期解析工具(优先调用)==================== |
nothing calls this directly
no test coverage detected