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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Check' implies a read-only operation, it doesn't specify what constitutes a trading day (e.g., market holidays, weekends), whether it requires authentication, rate limits, or what the return format looks like (e.g., boolean, detailed explanation). This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple tool, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter) but lack of annotations and output schema, the description is incomplete. It doesn't explain what defines a trading day, how results are returned, or potential error cases. For a tool in a financial context with many sibling tools, more contextual detail would help the agent use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It mentions 'a specific date' which aligns with the 'date' parameter, adding basic context about its purpose. However, it doesn't specify the expected date format (e.g., YYYY-MM-DD), timezone considerations, or validation rules, leaving the parameter only partially documented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Check') and resource ('trading day'), making it immediately understandable. However, it doesn't distinguish this tool from potential siblings like 'get_trade_dates' or 'get_last_n_trading_days', which might provide overlapping functionality about trading days.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_trade_dates' (which might list trading days) and 'next_trading_day'/'previous_trading_day' (which might find adjacent trading days), there's no indication of when this specific check is preferred or what its limitations are.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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