Skip to main content
Glama

get_time_info

Retrieve current time in ISO format, timestamp, and the last trading day for accurate time-based data analysis and synchronization.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_time_info' tool, decorated with @mcp.tool for registration. It returns current time info including the last trading day using akshare data.
    @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, }

Other Tools

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

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