Skip to main content
Glama
aahl

AkTools MCP Server

by aahl

stock_sector_fund_flow_rank

Analyze fund flow trends across Chinese A-share market sectors to identify investment opportunities and market movements.

Instructions

获取中国A股市场(上证、深证)的行业资金流向数据

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo天数,仅支持: {'今日','5日','10日'},如果需要获取今日数据,请确保是交易日今日
cateNo仅支持: {'行业资金流','概念资金流','地域资金流'}行业资金流

Implementation Reference

  • The handler function for the MCP tool 'stock_sector_fund_flow_rank'. It fetches sector fund flow ranking data using akshare via caching, sorts by daily change, drops sequence column, concatenates top and bottom 20 rows, and returns formatted CSV.
    @mcp.tool( title="A股板块资金流", description="获取中国A股市场(上证、深证)的行业资金流向数据", ) def stock_sector_fund_flow_rank( days: str = Field("今日", description="天数,仅支持: {'今日','5日','10日'},如果需要获取今日数据,请确保是交易日"), cate: str = Field("行业资金流", description="仅支持: {'行业资金流','概念资金流','地域资金流'}"), ): dfs = ak_cache(ak.stock_sector_fund_flow_rank, indicator=days, sector_type=cate, ttl=1200) if dfs is None: return "获取数据失败" try: dfs.sort_values("今日涨跌幅", ascending=False, inplace=True) dfs.drop(columns=["序号"], inplace=True) except Exception: pass try: dfs = pd.concat([dfs.head(20), dfs.tail(20)]) return dfs.to_csv(index=False, float_format="%.2f").strip() except Exception as exc: return str(exc)
  • Registration of the 'stock_sector_fund_flow_rank' tool using the @mcp.tool decorator, including title and description.
    @mcp.tool( title="A股板块资金流", description="获取中国A股市场(上证、深证)的行业资金流向数据", )
  • Input schema defined by Pydantic Field annotations for 'days' and 'cate' parameters.
    def stock_sector_fund_flow_rank( days: str = Field("今日", description="天数,仅支持: {'今日','5日','10日'},如果需要获取今日数据,请确保是交易日"), cate: str = Field("行业资金流", description="仅支持: {'行业资金流','概念资金流','地域资金流'}"), ):

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