Skip to main content
Glama
24mlight

A-Share MCP Server

get_latest_trading_date

Retrieve the most recent stock market trading date for China's A-share market to ensure accurate financial data analysis and reporting.

Instructions

Get the latest trading date up to today.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler function for 'get_latest_trading_date'. Logs the invocation and delegates execution to the use case layer via run_tool_with_handling.
    def get_latest_trading_date() -> str:
        """Get the latest trading date up to today."""
        logger.info("Tool 'get_latest_trading_date' called")
        return run_tool_with_handling(
            lambda: uc_date.get_latest_trading_date(active_data_source),
            context="get_latest_trading_date",
        )
  • Core helper function implementing the logic to fetch recent trading days from the data source and determine the latest trading date up to today.
    def get_latest_trading_date(data_source: FinancialDataSource) -> str:
        today = datetime.now().strftime("%Y-%m-%d")
        start_date = datetime.now().replace(day=1).strftime("%Y-%m-%d")
        end_date = datetime.now().replace(day=28).strftime("%Y-%m-%d")
        df = _fetch_trading_days(data_source, start_date=start_date, end_date=end_date)
        valid_trading_days = df[df["is_trading_day"] == "1"]["calendar_date"].tolist()
        latest_trading_date = None
        for dstr in valid_trading_days:
            if dstr <= today and (latest_trading_date is None or dstr > latest_trading_date):
                latest_trading_date = dstr
        return latest_trading_date or today
  • mcp_server.py:56-56 (registration)
    Invocation of the registration function that defines and registers the 'get_latest_trading_date' tool (among others) 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 the full burden. It states the tool retrieves the latest trading date, implying a read-only operation, but doesn't disclose behavioral traits such as data freshness, caching, rate limits, error conditions, or what 'up to today' means in edge cases (e.g., weekends, holidays). This leaves 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, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized for a simple tool with no parameters, making it easy to parse quickly.

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 simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate but lacks completeness. It doesn't explain the return value format (e.g., date string, timestamp), how 'latest' is determined, or handle edge cases, which could be important for an agent to use it correctly in context.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and a baseline score of 4 is appropriate as it doesn't introduce confusion or omissions regarding inputs.

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 action ('Get') and the resource ('latest trading date up to today'), making the purpose understandable. However, it doesn't explicitly differentiate from similar sibling tools like 'get_trade_dates', 'get_last_n_trading_days', or 'get_month_end_trading_dates', which could also provide trading date information with different scopes or filters.

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 multiple sibling tools related to trading dates (e.g., 'get_trade_dates', 'get_last_n_trading_days'), there is no indication of specific use cases, prerequisites, or comparisons to help an agent choose appropriately.

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