Skip to main content
Glama
al-one

MCP Server for stock and crypto

get_current_time

Retrieve current system time and A-share trading day information to verify date parameters before using other financial data tools.

Instructions

获取当前系统时间及A股交易日信息,建议在调用其他需要日期参数的工具前使用该工具

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_current_time' tool. It retrieves the current datetime, determines the weekday in Chinese, fetches recent A-share trading dates using ak_cache and ak.tool_trade_date_hist_sina, and returns formatted information.
    def get_current_time(): now = datetime.now() week = "日一二三四五六日"[now.isoweekday()] texts = [f"当前时间: {now.isoformat()}, 星期{week}"] dfs = ak_cache(ak.tool_trade_date_hist_sina, ttl=43200) if dfs is not None: start = now.date() - timedelta(days=5) ended = now.date() + timedelta(days=5) dates = [ d.strftime("%Y-%m-%d") for d in dfs["trade_date"] if start <= d <= ended ] texts.append(f", 最近交易日有: {','.join(dates)}") return "".join(texts)
  • Registration of the 'get_current_time' tool using the @mcp.tool decorator, specifying title and description.
    @mcp.tool( title="获取当前时间及A股交易日信息", description="获取当前系统时间及A股交易日信息,建议在调用其他需要日期参数的工具前使用该工具", )

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/al-one/mcp-aktools'

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