Skip to main content
Glama
24mlight

A-Share MCP Server

is_trading_day

Determine if a specific date is a trading day for China's A-share stock market to plan investment activities and avoid non-trading periods.

Instructions

Check if a specific date is a trading day.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes

Implementation Reference

  • MCP tool handler and registration for 'is_trading_day'. It wraps the use case function with error handling and logging via run_tool_with_handling.
    @app.tool() def is_trading_day(date: str) -> str: """Check if a specific date is a trading day.""" return run_tool_with_handling( lambda: uc_date.is_trading_day(active_data_source, date=date), context=f"is_trading_day:{date}", )
  • Core logic for determining if a date is a trading day. Fetches trade dates from data source and checks the 'is_trading_day' column value.
    def is_trading_day(data_source: FinancialDataSource, *, date: str) -> str: df = _fetch_trading_days(data_source, start_date=date, end_date=date) if df.empty: return "未知" row = df.iloc[0] return "是" if str(row.get("is_trading_day", "")) == "1" else "否"
  • mcp_server.py:56-56 (registration)
    Top-level registration call that sets up the date utils tools, including 'is_trading_day'.
    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