Skip to main content
Glama
al-one

MCP Server for stock and crypto

A股强势股池

stock_zt_pool_strong_em

Retrieve strong stock pool data from China A-share market (Shanghai and Shenzhen) for a given trading date, with adjustable number of stocks.

Instructions

获取中国A股市场(上证、深证)的强势股池数据

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo交易日日期(可选),默认为最近的交易日,格式: 20251231
limitNo返回数量(int,30-100)

Implementation Reference

  • Tool registration via @mcp.tool decorator with title 'A股强势股池' and description for A-share strong stock pool data.
    @mcp.tool(
        title="A股强势股池",
        description="获取中国A股市场(上证、深证)的强势股池数据",
    )
  • Main handler function `stock_zt_pool_strong_em` that fetches A-share strong stock pool data via ak.stock_zt_pool_strong_em, caches with ttl=1200s, drops '序号'/'流通市值'/'总市值' columns, sorts by '成交额' descending, limits results, and returns CSV format.
    def stock_zt_pool_strong_em(
        date: str = Field("", description="交易日日期(可选),默认为最近的交易日,格式: 20251231"),
        limit: int = Field(50, description="返回数量(int,30-100)", strict=False),
    ):
        if not date:
            date = recent_trade_date().strftime("%Y%m%d")
        dfs = ak_cache(ak.stock_zt_pool_strong_em, date=date, ttl=1200)
        try:
            dfs.drop(columns=["序号", "流通市值", "总市值"], inplace=True)
        except Exception:
            pass
        dfs.sort_values("成交额", ascending=False, inplace=True)
        dfs = dfs.head(int(limit))
        return dfs.to_csv(index=False, float_format="%.2f").strip()
  • Helper function `ak_cache` that provides two-tier caching (memory TTL cache + disk cache) for akshare API calls. Called by the handler to cache ak.stock_zt_pool_strong_em results with ttl=1200.
    def ak_cache(fun, *args, **kwargs) -> pd.DataFrame | None:
        key = kwargs.pop("key", None)
        if not key:
            key = f"{fun.__name__}-{args}-{kwargs}"
        ttl1 = kwargs.pop("ttl", 86400)
        ttl2 = kwargs.pop("ttl2", None)
        cache = CacheKey.init(key, ttl1, ttl2)
        all = cache.get()
        if all is None:
            try:
                _LOGGER.info("Request akshare: %s", [key, args, kwargs])
                all = fun(*args, **kwargs)
                cache.set(all)
            except Exception as exc:
                _LOGGER.exception(str(exc))
        return all
  • Helper function `recent_trade_date` used by the handler to determine the most recent trading date when no date is provided.
    def recent_trade_date():
        now = datetime.now().date()
        dfs = ak_cache(ak.tool_trade_date_hist_sina, ttl=43200)
        if dfs is None:
            return now
        dfs.sort_values("trade_date", ascending=False, inplace=True)
        for d in dfs["trade_date"]:
            if d <= now:
                return d
        return now
Behavior2/5

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

No annotations are provided, so the description must disclose behaviors. It only states '获取' (fetch) without mentioning whether it's read-only, authorization needs, rate limits, or any side effects. Minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but lacks important details. It is front-loaded with the main action but omits key context.

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

Completeness2/5

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

No output schema is provided, so the description should explain the return data structure. It does not, leaving the agent uncertain about what data is returned (e.g., list of stocks, fields, format).

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

Parameters3/5

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

Schema coverage is 100%, with each parameter having a description. The tool description adds no additional meaning beyond what the schema already provides, so baseline score of 3 applies.

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?

Description clearly states it retrieves strong stock pool data for A-share markets (Shanghai/Shenzhen). However, it does not distinguish from sibling tool 'stock_zt_pool_em', which likely refers to limit-up pool, leaving ambiguity about the exact selection criteria.

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 on when to use this tool versus alternatives like 'stock_zt_pool_em'. The description lacks context for tool selection.

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

Install Server

Other Tools

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