Skip to main content
Glama
24mlight

A-Share MCP Server

get_zz500_stocks

Retrieve current or historical CSI 500 index constituents from China's A-share market. Specify date and format to access stock data for analysis.

Instructions

CSI 500 constituents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo
limitNo
formatNomarkdown

Implementation Reference

  • The primary MCP tool handler for 'get_zz500_stocks', decorated with @app.tool() for automatic registration and schema inference. Executes by calling the indices use case with index='zz500'.
    @app.tool()
    def get_zz500_stocks(date: Optional[str] = None, limit: int = 250, format: str = "markdown") -> str:
        """CSI 500 constituents."""
        return run_tool_with_handling(
            lambda: fetch_index_constituents(active_data_source, index="zz500", date=date, limit=limit, format=format),
            context="get_zz500_stocks",
        )
  • mcp_server.py:53-53 (registration)
    Top-level call to register_index_tools, which defines and registers the get_zz500_stocks tool along with other index tools.
    register_index_tools(app, active_data_source)
  • Helper use case function that dispatches to data_source.get_zz500_stocks() for 'zz500' index, validates input, and formats the DataFrame output as markdown or other.
    def fetch_index_constituents(data_source: FinancialDataSource, *, index: str, date: Optional[str], limit: int, format: str) -> str:
        validate_output_format(format)
        key = validate_index_key(index, INDEX_MAP)
        if key == "hs300":
            df = data_source.get_hs300_stocks(date=date)
        elif key == "sz50":
            df = data_source.get_sz50_stocks(date=date)
        else:
            df = data_source.get_zz500_stocks(date=date)
        meta = {"index": key, "as_of": date or "latest"}
        return format_table_output(df, format=format, max_rows=limit, meta=meta)
  • Concrete data source implementation that calls Baostock's query_zz500_stocks API via a shared helper to fetch CSI 500 constituents.
    def get_zz500_stocks(self, date: Optional[str] = None) -> pd.DataFrame:
        """Fetches CSI 500 index constituents using Baostock."""
        return _fetch_index_constituent_data(bs.query_zz500_stocks, "CSI 500", date)
  • Interface definition specifying the get_zz500_stocks method signature for data sources.
    @abstractmethod
    def get_zz500_stocks(self, date: Optional[str] = None) -> pd.DataFrame:
        pass
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to describe what the tool does (e.g., retrieves, lists, or filters constituents), expected outputs, error conditions, or any behavioral traits like rate limits or data freshness. This leaves the agent with no operational context beyond the tautological statement.

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 extremely concise with a single phrase, but this brevity leads to under-specification rather than efficiency. It's front-loaded but lacks necessary detail, making it inadequate rather than optimally structured. While not verbose, it fails to convey essential information.

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

Completeness1/5

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

Given the tool's complexity (3 parameters, no annotations, no output schema), the description is completely inadequate. It doesn't explain the action, parameters, outputs, or behavioral context, leaving the agent unable to understand how to use the tool effectively. This is insufficient for a data retrieval tool with multiple inputs.

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

Parameters1/5

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

With 0% schema description coverage and 3 parameters (date, limit, format), the description adds no meaning beyond what the input schema provides. It doesn't explain what the parameters do (e.g., date for historical constituents, limit for pagination, format for output type), leaving them undocumented and unclear in purpose.

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

Purpose2/5

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

The description 'CSI 500 constituents' restates the tool name 'get_zz500_stocks' in different words (tautology), providing minimal clarification. It mentions the resource (CSI 500 constituents) but lacks a specific verb or action, making the purpose vague. Compared to siblings like 'get_hs300_stocks' or 'get_sz50_stocks', it doesn't differentiate beyond the index name.

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

Usage Guidelines1/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. It doesn't mention siblings like 'get_hs300_stocks' for different indices or 'get_index_constituents' for general index data, nor does it specify prerequisites or exclusions. The description offers no contextual usage information.

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/24mlight/a-share-mcp-is-just-i-need'

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