Skip to main content
Glama
24mlight

A Share MCP

next_trading_day

Calculate the next trading day after a specified date for A-share market planning and scheduling.

Instructions

Get the next trading day after the given date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes

Implementation Reference

  • The MCP tool handler for 'next_trading_day'. It is decorated with @app.tool() which registers it, and executes the core logic by delegating to the use case layer via run_tool_with_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 implementation logic of next_trading_day. Fetches trading days from data source, filters future trading days after the input date, and returns the earliest one.
    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_date_utils_tools function, which defines and registers the next_trading_day tool (and other date utils) to the FastMCP app.
    register_date_utils_tools(app, active_data_source)
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose what 'trading day' means (e.g., market holidays, weekends), error handling for invalid dates, timezone considerations, or output format. This leaves significant gaps for a tool that likely involves calendar logic and financial market rules.

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, efficient sentence that front-loads the core purpose without fluff. Every word earns its place, making it easy to parse quickly. No structural issues or redundancy are present.

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 no annotations, no output schema, and low parameter coverage, the description is incomplete. It doesn't explain return values (e.g., date string, object), error cases, or dependencies on market data. For a tool that likely involves non-trivial date logic, this lacks necessary context for reliable agent use.

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

Parameters2/5

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

The schema has 0% description coverage, with one required parameter 'date' undocumented in schema. The description adds minimal semantics by implying 'date' is an input for calculation but doesn't specify format (e.g., YYYY-MM-DD), constraints (e.g., past/future dates), or examples. It fails to compensate for the low schema coverage, leaving parameter meaning vague.

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 the resource 'next trading day', specifying it operates 'after the given date'. It distinguishes from siblings like 'get_last_n_trading_days' or 'previous_trading_day' by focusing on a single forward date. However, it doesn't explicitly differentiate from 'get_trade_dates' or 'is_trading_day', which could provide similar date-related information.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention siblings like 'previous_trading_day' for backward lookups, 'get_trade_dates' for ranges, or 'is_trading_day' for validation. The description implies usage for date advancement but offers no context on prerequisites, exclusions, or comparative scenarios.

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