Skip to main content
Glama
24mlight

A-Share MCP Server

get_latest_trading_date

Retrieve the most recent stock market trading date for China's A-share market to ensure accurate financial data analysis and reporting.

Instructions

Get the latest trading date up to today.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler function for 'get_latest_trading_date'. Logs the invocation and delegates execution to the use case layer via run_tool_with_handling.
    def get_latest_trading_date() -> str: """Get the latest trading date up to today.""" logger.info("Tool 'get_latest_trading_date' called") return run_tool_with_handling( lambda: uc_date.get_latest_trading_date(active_data_source), context="get_latest_trading_date", )
  • Core helper function implementing the logic to fetch recent trading days from the data source and determine the latest trading date up to today.
    def get_latest_trading_date(data_source: FinancialDataSource) -> str: today = datetime.now().strftime("%Y-%m-%d") start_date = datetime.now().replace(day=1).strftime("%Y-%m-%d") end_date = datetime.now().replace(day=28).strftime("%Y-%m-%d") df = _fetch_trading_days(data_source, start_date=start_date, end_date=end_date) valid_trading_days = df[df["is_trading_day"] == "1"]["calendar_date"].tolist() latest_trading_date = None for dstr in valid_trading_days: if dstr <= today and (latest_trading_date is None or dstr > latest_trading_date): latest_trading_date = dstr return latest_trading_date or today
  • mcp_server.py:56-56 (registration)
    Invocation of the registration function that defines and registers the 'get_latest_trading_date' tool (among others) to the FastMCP app.
    register_date_utils_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