Skip to main content
Glama
aahl

AkTools MCP Server

by aahl

get_current_time

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

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Full implementation of the get_current_time tool handler, decorated with @mcp.tool for registration. Returns current time and recent A-share trading days.
    @mcp.tool(
        title="获取当前时间及A股交易日信息",
        description="获取当前系统时间及A股交易日信息,建议在调用其他需要日期参数的工具前使用该工具",
    )
    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)

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

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