Skip to main content
Glama
al-one

MCP Server for stock and crypto

stock_news_global

Access global financial news updates to monitor market developments and inform investment decisions.

Instructions

获取最新的全球财经快讯

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 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 and returns it.
    @mcp.tool(
        title="全球财经快讯",
        description="获取最新的全球财经快讯",
    )
    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)
  • Helper function newsnow_news() that retrieves latest news from NewsNow API channels and is called within the stock_news_global handler.
    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/al-one/mcp-aktools'

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