Skip to main content
Glama
24mlight

A Share MCP

get_industry_members

Retrieve all stocks within a specific industry on a given date using A Share MCP server data. This tool helps identify industry constituents for market analysis and portfolio tracking.

Instructions

Get all stocks in a given industry on a date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
industryYes
dateNo
limitNo
formatNomarkdown

Implementation Reference

  • MCP tool handler for 'get_industry_members'. Registered via @app.tool() decorator. Delegates to use case logic via run_tool_with_handling.
    @app.tool() def get_industry_members(industry: str, date: Optional[str] = None, limit: int = 250, format: str = "markdown") -> str: """Get all stocks in a given industry on a date.""" logger.info("Tool 'get_industry_members' called industry=%s, date=%s", industry, date or "latest") return run_tool_with_handling( lambda: fetch_industry_members(active_data_source, industry=industry, date=date, limit=limit, format=format), context=f"get_industry_members:{industry}", )
  • Core implementation logic for fetching and formatting industry members from the data source.
    def fetch_industry_members(data_source: FinancialDataSource, *, industry: str, date: Optional[str], limit: int, format: str) -> str: validate_output_format(format) validate_non_empty_str(industry, "industry") df = data_source.get_stock_industry(code=None, date=date) if df is None or df.empty: return "(No data available to display)" col = "industry" if "industry" in df.columns else df.columns[-1] filtered = df[df[col] == industry].copy() meta = {"industry": industry, "as_of": date or "latest"} return format_table_output(filtered, format=format, max_rows=limit, meta=meta)
  • mcp_server.py:53-53 (registration)
    Registers the index tools module, including 'get_industry_members', by calling register_index_tools.
    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