Skip to main content
Glama
24mlight

A Share MCP

is_trading_day

Check if a specific date is a trading day for A-share stock markets to plan investments and avoid non-trading periods.

Instructions

Check if a specific date is a trading day.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes

Implementation Reference

  • The MCP tool handler for 'is_trading_day', decorated with @app.tool() for automatic registration and execution. It wraps the use case call with error 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 helper function implementing the trading day check by fetching trade dates from data source and inspecting the 'is_trading_day' field.
    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)
    Invocation of the registration function that defines and registers the 'is_trading_day' tool along with other date utilities.
    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