Skip to main content
Glama
aahl

AkTools MCP Server

by aahl

stock_news_global

Fetch global financial news updates to monitor market developments and economic trends for informed investment decisions.

Instructions

获取最新的全球财经快讯

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'stock_news_global' tool. It fetches global finance news from akshare's stock_info_global_sina and the custom newsnow_news helper, formats it, and returns as a string.
    def stock_news_global(): news = [] try: dfs = ak.stock_info_global_sina() csv = dfs.to_csv(index=False, float_format="%.2f").strip() csv = csv.replace(datetime.now().strftime("%Y-%m-%d "), "") news.extend(csv.split("\n")) except Exception: pass news.extend(newsnow_news()) return "\n".join(news)
  • The @mcp.tool decorator registers the 'stock_news_global' tool with title and description.
    @mcp.tool( title="全球财经快讯", description="获取最新的全球财经快讯", )
  • Helper function newsnow_news() called by the handler to fetch additional news from NewsNow API using POST request.
    def newsnow_news(channels=None): base = os.getenv("NEWSNOW_BASE_URL") if not base: return [] if not channels: channels = os.getenv("NEWSNOW_CHANNELS") or "wallstreetcn-quick,cls-telegraph,jin10" if isinstance(channels, str): channels = channels.split(",") all = [] try: res = requests.post( f"{base}/api/s/entire", json={"sources": channels}, headers={ "User-Agent": USER_AGENT, "Referer": base, }, timeout=60, ) lst = res.json() or [] for item in lst: for v in item.get("items", [])[0:15]: title = v.get("title", "") extra = v.get("extra") or {} hover = extra.get("hover") or title info = extra.get("info") or "" all.append(f"{hover} {info}".strip().replace("\n", " ")) except Exception: pass return all

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/aahl/mcp-aktools'

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