Skip to main content
Glama
24mlight

A-Share MCP Server

get_month_end_trading_dates

Retrieve month-end trading dates for China's A-share market by specifying a year. This tool helps identify the last trading day of each month for scheduling and analysis purposes.

Instructions

Return month-end trading dates for a given year.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes

Implementation Reference

  • The core handler function that implements the logic to retrieve the last trading day of each month for a given year by querying the financial data source for trading days in the week leading up to the month's end.
    def get_month_end_trading_dates(data_source: FinancialDataSource, *, year: int) -> str:
        results = []
        for month in range(1, 13):
            last_day = calendar.monthrange(year, month)[1]
            start_date = datetime(year, month, last_day - 7).strftime("%Y-%m-%d")
            end_date = datetime(year, month, last_day).strftime("%Y-%m-%d")
            df = _fetch_trading_days(data_source, start_date=start_date, end_date=end_date)
            trading_days = df[df["is_trading_day"] == "1"]["calendar_date"].tolist()
            if trading_days:
                results.append(trading_days[-1])
        return ", ".join(results)
  • The tool registration decorator (@app.tool()) and wrapper function that handles the tool invocation, logging context, and delegates execution to the use_cases layer handler.
    @app.tool()
    def get_month_end_trading_dates(year: int) -> str:
        """Return month-end trading dates for a given year."""
        return run_tool_with_handling(
            lambda: uc_date.get_month_end_trading_dates(active_data_source, year=year),
            context=f"get_month_end_trading_dates:{year}",
        )
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. It states the tool returns dates but doesn't specify format (e.g., list of strings, timestamps), timezone, handling of holidays, or error behavior for invalid years. For a read-only tool with no annotations, this leaves significant gaps in understanding its operation.

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 functionality ('Return month-end trading dates') and includes the key constraint ('for a given year'). There is no wasted wording, and it's appropriately sized for a simple query tool.

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

Completeness3/5

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

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally complete but lacks depth. It covers the basic purpose but misses details on output format, error handling, and usage context relative to siblings. For a simple read tool, this is adequate but with clear gaps in guidance and transparency.

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 input schema has 0% description coverage, with one parameter 'year' of type integer. The description adds minimal semantics by implying 'year' is required for filtering, but doesn't specify valid ranges (e.g., historical limits), format, or examples. With low schema coverage, it partially compensates but not fully, aligning with the baseline for moderate gaps.

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 ('Return') and resource ('month-end trading dates'), and specifies the input constraint ('for a given year'). It distinguishes from siblings like 'get_trade_dates' by focusing on month-end dates only. However, it doesn't explicitly contrast with 'get_last_n_trading_days' or 'get_latest_trading_date', which slightly limits differentiation.

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. It doesn't mention sibling tools like 'get_trade_dates' (which might return all trading dates) or 'get_last_n_trading_days' (which might return recent dates), leaving the agent to infer usage context. No exclusions or prerequisites are stated.

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