Skip to main content
Glama
aahl

AkTools MCP Server

by aahl

A股关键指标

stock_indicators_a

Retrieves key financial report indicators for Chinese A-share stocks listed on the Shanghai and Shenzhen exchanges, providing essential financial metrics for analysis.

Instructions

获取中国A股市场(上证、深证)的股票财务报告关键指标

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes股票代码

Implementation Reference

  • The @mcp.tool decorator registers 'stock_indicators_a' as an MCP tool with title 'A股关键指标' and description in Chinese.
    @mcp.tool(
        title="A股关键指标",
        description="获取中国A股市场(上证、深证)的股票财务报告关键指标",
    )
  • The handler function 'stock_indicators_a' takes a stock symbol, calls ak_cache with ak.stock_financial_abstract_ths to fetch A-share financial indicators, and returns CSV data with header and last 15 rows.
    def stock_indicators_a(
        symbol: str = field_symbol,
    ):
        dfs = ak_cache(ak.stock_financial_abstract_ths, symbol=symbol)
        keys = dfs.to_csv(index=False, float_format="%.3f").strip().split("\n")
        return "\n".join([keys[0], *keys[-15:]])
  • The 'ak_cache' helper function provides caching (in-memory + disk) for akshare API calls, used by stock_indicators_a to cache results.
    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
  • The 'field_symbol' and 'field_market' Field definitions used as parameter defaults in stock_indicators_a and other tools.
    field_symbol = Field(description="股票代码")
    field_market = Field("sh", description="股票市场,仅支持: sh(上证), sz(深证), hk(港股), us(美股), 不支持加密货币")
Behavior2/5

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

No annotations are provided, and the description fails to disclose any behavioral traits (e.g., read-only, required permissions, rate limits). As a read operation, this is a notable omission.

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

Conciseness4/5

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

The description is a single concise sentence without extraneous content. While efficient, it could include a bit more detail without becoming verbose.

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?

Without an output schema, the description does not clarify what 'key financial report indicators' includes or how the output is structured. This vagueness makes the tool less usable for an AI agent.

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?

The input schema covers the single parameter 'symbol' with a description of '股票代码', and the description adds market context but no additional parameter specifics. Given 100% schema coverage, a baseline of 3 is appropriate.

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

Purpose5/5

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

The description specifies the tool retrieves key financial report indicators for Chinese A-share stocks (Shanghai and Shenzhen exchanges), clearly distinguishing it from sibling tools for Hong Kong and US stocks.

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

Usage Guidelines3/5

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

The description implies usage for A-share stocks by naming the market, but offers no explicit guidance on when to use this tool versus alternatives (e.g., stock_indicators_hk) or conditions to avoid.

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

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