Skip to main content
Glama
24mlight

A-Share MCP Server

get_zz500_stocks

Retrieve CSI 500 Index constituent stocks for a specified date via the A-Share MCP Server, returning results in a markdown table format for clarity and analysis.

Instructions

Fetches the constituent stocks of the CSI 500 Index for a given date. Args: date: Optional. The date in 'YYYY-MM-DD' format. If None, uses the latest available date. Returns: Markdown table with CSI 500 constituent stocks or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo

Implementation Reference

  • Primary handler function for the 'get_zz500_stocks' MCP tool. Decorated with @app.tool() for automatic registration and schema inference. Implements tool logic by delegating data fetch to active_data_source and formatting output.
    @app.tool() def get_zz500_stocks(date: Optional[str] = None, limit: int = 250, format: str = "markdown") -> str: """ Fetch the constituent stocks of the CSI 500 Index for a given date. Args: date: Optional 'YYYY-MM-DD'. If None, uses the latest available date. Returns: Markdown table with CSI 500 constituent stocks or an error message. """ return call_index_constituent_tool( "get_zz500_stocks", active_data_source.get_zz500_stocks, "CSI 500", date, limit=limit, format=format )
  • Core data retrieval helper in BaostockDataSource class. Fetches CSI 500 (ZZ500) constituent stocks from Baostock API via _fetch_index_constituent_data utility.
    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)
  • mcp_server.py:53-53 (registration)
    Explicit registration of index tools (including get_zz500_stocks) by calling register_index_tools during MCP app initialization.
    register_index_tools(app, active_data_source)

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