Skip to main content
Glama
24mlight

A Share MCP

by 24mlight

get_latest_trading_date

Retrieve the most recent stock market trading date for A-share market data analysis and financial reporting.

Instructions

Get the latest trading date up to today.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_latest_trading_date'. Decorated with @app.tool(), logs the invocation, and delegates execution to the use-case layer using run_tool_with_handling.
    @app.tool()
    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 implementation that fetches recent trading days from the data source and determines 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)
    Calls the registration function that defines and registers the 'get_latest_trading_date' tool with 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 mentions retrieving the 'latest trading date up to today' but lacks details on behavior such as data source, timezone handling, error conditions, or whether it considers market holidays. This leaves gaps for an AI agent to understand operational nuances.

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 no wasted words. It's front-loaded and efficiently conveys the core functionality without unnecessary elaboration.

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 and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., date format, single value vs. structured data) or address potential edge cases like non-trading days, which are crucial for a tool in a financial context with many sibling tools.

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 no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here, earning a baseline score for tools with no parameters.

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 ('latest trading date up to today'), making the purpose understandable. However, it doesn't explicitly differentiate from siblings like 'get_last_n_trading_days' or 'get_trade_dates', 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 like 'get_last_n_trading_days' or 'get_trade_dates'. The description only states what it does without context for selection among siblings.

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