Skip to main content
Glama
24mlight

A-Share MCP Server

get_hs300_stocks

Retrieve CSI 300 index constituents to analyze China's A-share market performance. Provides stock data for tracking major Chinese companies.

Instructions

CSI 300 constituents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo
limitNo
formatNomarkdown

Implementation Reference

  • The primary MCP tool handler function for 'get_hs300_stocks', decorated with @app.tool() for automatic registration, which delegates execution to the use case layer via run_tool_with_handling.
    @app.tool()
    def get_hs300_stocks(date: Optional[str] = None, limit: int = 250, format: str = "markdown") -> str:
        """CSI 300 constituents."""
        return run_tool_with_handling(
            lambda: fetch_index_constituents(active_data_source, index="hs300", date=date, limit=limit, format=format),
            context="get_hs300_stocks",
        )
  • mcp_server.py:53-53 (registration)
    The call to register_index_tools that registers the 'get_hs300_stocks' tool (along with other index tools) to the FastMCP app instance.
    register_index_tools(app, active_data_source)
  • Abstract method definition in the FinancialDataSource interface serving as the schema for the underlying data retrieval method called by the tool chain.
    @abstractmethod
    def get_hs300_stocks(self, date: Optional[str] = None) -> pd.DataFrame:
        pass
  • Use case layer helper function 'fetch_index_constituents' that routes 'hs300' requests to data_source.get_hs300_stocks() and handles formatting.
    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 of 'get_hs300_stocks' using Baostock's query_hs300_stocks API via a shared helper _fetch_index_constituent_data.
    def get_hs300_stocks(self, date: Optional[str] = None) -> pd.DataFrame:
        """Fetches CSI 300 index constituents using Baostock."""
        return _fetch_index_constituent_data(bs.query_hs300_stocks, "CSI 300", date)
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It offers no information about what the tool does operationally (e.g., returns a list, fetches real-time data, requires authentication, has rate limits, or pagination behavior). The description is completely silent on these critical aspects.

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 extremely concise at just three words, with no wasted language. However, this conciseness comes at the cost of being severely under-specified rather than efficiently informative.

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 3 parameters with no schema descriptions, no annotations, no output schema, and multiple similar sibling tools, the description is completely inadequate. It doesn't explain what the tool returns, how to use parameters, or when to choose it over alternatives, failing to provide necessary context for effective use.

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 3 parameters (date, limit, format) and 0% schema description coverage, the schema provides only titles and types without explanations. The description adds no information about what these parameters mean, how they affect results, or their expected formats (e.g., date format, limit constraints, format options). This leaves parameters essentially undocumented.

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 300 constituents' restates the tool name 'get_hs300_stocks' (HS300 refers to CSI 300) without specifying the action. It doesn't clearly state whether this tool retrieves, lists, filters, or analyzes the constituents. While it identifies the resource (CSI 300 stocks), it lacks a specific verb, making the purpose vague and tautological.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'get_index_constituents', 'get_sz50_stocks', and 'get_zz500_stocks' that likely serve similar functions for different indices, there's no indication of when this specific tool is appropriate or what distinguishes it from others.

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