Skip to main content
Glama
24mlight

A-Share MCP Server

next_trading_day

Calculate the next trading day in China's A-share market after a specified date to plan investment activities and schedule transactions.

Instructions

Get the next trading day after the given date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes

Implementation Reference

  • MCP tool handler for next_trading_day, registered with @app.tool() and delegates to the use case layer with error handling.
    @app.tool() def next_trading_day(date: str) -> str: """Get the next trading day after the given date.""" return run_tool_with_handling( lambda: uc_date.next_trading_day(active_data_source, date=date), context=f"next_trading_day:{date}", )
  • Core logic implementation of next_trading_day, which fetches trading days around the given date and returns the next trading day.
    def next_trading_day(data_source: FinancialDataSource, *, date: str) -> str: target = datetime.strptime(date, "%Y-%m-%d") end = (target + timedelta(days=31)).strftime("%Y-%m-%d") df = _fetch_trading_days(data_source, start_date=date, end_date=end) days = df[df["is_trading_day"] == "1"]["calendar_date"].tolist() next_day = min([d for d in days if d > date], default=None) return next_day or date
  • mcp_server.py:56-56 (registration)
    Invocation of the register function that adds the next_trading_day tool (among others) to the MCP 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