Skip to main content
Glama
zwldarren

akshare-one-mcp

get_time_info

Retrieve current time in ISO format, timestamp, and the last trading day for financial data synchronization and time-sensitive operations.

Instructions

Get current time with ISO format, timestamp, and the last trading day.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_time_info' tool, decorated with @mcp.tool which also serves as registration. It fetches the current time, timestamp, and the last trading day using akshare's trading calendar.
    @mcp.tool
    def get_time_info() -> dict:
        """Get current time with ISO format, timestamp, and the last trading day."""
        local_time = datetime.now().astimezone()
        current_date = local_time.date()
    
        # Get trading calendar
        trade_date_df = ak.tool_trade_date_hist_sina()
        trade_dates = [d for d in trade_date_df["trade_date"]]
    
        # Filter dates <= current date and sort descending
        past_dates = sorted([d for d in trade_dates if d <= current_date], reverse=True)
    
        # Find the most recent trading day
        last_trading_day = past_dates[0].strftime("%Y-%m-%d") if past_dates else None
    
        return {
            "iso_format": local_time.isoformat(),
            "timestamp": local_time.timestamp(),
            "last_trading_day": last_trading_day,
        }

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/zwldarren/akshare-one-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server