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

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

No annotations are provided, so the description carries full burden. It states what the tool does but doesn't disclose behavioral traits like what happens if the input date is already a trading day, whether weekends/holidays are skipped, timezone considerations, error handling, or return format. For a date calculation tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 efficiently communicates the essential function. Every word earns its place, making it easy to parse 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 complexity (date calculation with financial calendar logic), no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what constitutes a 'trading day', how holidays are handled, what the return value looks like, or edge cases. For a tool that likely involves business logic beyond simple date arithmetic, more context is needed.

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?

Schema description coverage is 0%, so the description must compensate. It mentions 'the given date' which maps to the single parameter, adding context about its purpose. However, it doesn't specify the date format (e.g., YYYY-MM-DD), validation rules, or examples. The description provides basic semantic meaning but lacks detailed parameter guidance that would be needed given the low schema coverage.

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 verb ('Get') and resource ('next trading day') with a specific condition ('after the given date'). It distinguishes from siblings like 'get_last_n_trading_days', 'get_trade_dates', and 'previous_trading_day' by focusing on the single next trading day after a specific date. However, it doesn't explicitly contrast with these siblings in the description text itself.

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 like 'previous_trading_day', 'get_last_n_trading_days', or 'is_trading_day'. It doesn't mention prerequisites, exclusions, or typical use cases. The agent must infer usage from the tool name and description alone without explicit direction.

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