MCPcopy
hub / github.com/sansan0/TrendRadar / get_keywords_resource

Function get_keywords_resource

mcp_server/server.py:99–113  ·  view source on GitHub ↗

获取关注词配置 返回 frequency_words.txt 中配置的关注词分组。

()

Source from the content-addressed store, hash-verified

97
98@mcp.resource("config://keywords")
99async 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# ==================== 日期解析工具(优先调用)====================

Callers

nothing calls this directly

Calls 2

_get_toolsFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected