Skip to main content
Glama
aahl

MCP Server for stock and crypto

by aahl

全球财经快讯

stock_news_global

Access global financial news covering stock markets and cryptocurrencies.

Instructions

获取最新的全球财经快讯

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'stock_news_global' tool. It fetches global financial news via akshare's stock_info_global_sina() and additionally pulls news from the NewsNow API via the newsnow_news() helper.
    @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)
  • Registration of the 'stock_news_global' tool via @mcp.tool decorator with title '全球财经快讯' and description '获取最新的全球财经快讯'.
    @mcp.tool(
        title="全球财经快讯",
        description="获取最新的全球财经快讯",
  • Helper function newsnow_news() called by stock_news_global to fetch additional news from configurable NewsNow API channels.
    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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are present, so the description carries the full burden. It does not disclose whether the operation is read-only, any rate limits, response format, or other behavior. The description only restates the basic action without adding beyond-obvious detail.

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 a single, short sentence that directly states the tool's purpose. It is front-loaded and contains no unnecessary words or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a no-parameter, low-complexity tool, the description is minimally viable: the agent can infer that calling it returns current global financial news. However, there is no output schema and the description does not specify the returned data structure, fields, or source, leaving the agent uncertain about the response form.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the description cannot add parameter-level meaning. The input schema is already complete with no properties, and the baseline for zero parameters is 4.

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

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('获取' - get) and resource ('全球财经快讯' - global financial news), clarifying that this tool returns the latest global financial news. It does not explicitly contrast with sibling tool stock_news, though the 'global' qualifier partially differentiates it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to choose this tool over alternatives like stock_news or market_prices. There is no mention of scenarios, exclusions, or recommended use cases, leaving the agent to infer.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.