Skip to main content
Glama
24mlight

A Share MCP

by 24mlight

get_month_end_trading_dates

Retrieve month-end trading dates for A-share markets in a specified year to support financial analysis and reporting.

Instructions

Return month-end trading dates for a given year.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes

Implementation Reference

  • MCP tool handler function for 'get_month_end_trading_dates'. It wraps the use case execution with error handling via run_tool_with_handling.
    @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}",
        )
  • Core helper function implementing the logic to fetch the last trading day of each month for a given year using the financial data source.
    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)
  • mcp_server.py:56-56 (registration)
    Invocation of register_date_utils_tools which registers the date utility tools, including 'get_month_end_trading_dates', 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?

No annotations are provided, so the description carries full burden. It states the action but lacks behavioral details such as return format (e.g., list of dates), error handling for invalid years, data source, or rate limits. This is inadequate 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, efficient sentence with zero waste. It's front-loaded with the core purpose, making it easy to parse. Every word earns its place without redundancy.

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, 0% schema coverage, and no output schema, the description is incomplete. It doesn't explain return values, error cases, or behavioral traits, leaving significant gaps for a tool that likely returns structured date data. More context is needed for effective use.

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%, but the description adds meaning by specifying the parameter is 'year'. However, it doesn't clarify format (e.g., integer year like 2024), constraints (e.g., valid range), or examples. With one parameter, this provides minimal compensation for the coverage gap.

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 ('Return') and resource ('month-end trading dates'), specifying it's for a given year. It distinguishes from siblings like 'get_trade_dates' (general dates) and 'get_last_n_trading_days' (recent days), but could be more explicit about the distinction. No tautology or misleading elements are present.

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 prerequisites, exclusions, or compare to siblings like 'get_trade_dates' for broader date queries or 'get_latest_trading_date' for single dates. Usage is implied only by the purpose statement.

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