SuperAPI AI Directory

ifind-finance-data

Data & analytics

View repository

Updated 10-16 08:49

About this skill

Tonghuashun Financial Data Query (iFind-finance-data)
  • This skill is used to query stocks, funds, macroeconomic, industry economic, and news announcement data
  • Core capabilities: intelligent stock and fund selection, financial data query, announcement and information search, macroeconomic and industry indicator search
  • Data coverage includes stocks, funds, macroeconomic, industry economic, and news announcement data

Usage

This skill encapsulates the calling interface of the Tonghuashun financial data MCP service, supporting both Python and Node.js calling methods:

  • Node.js solution: use call-node.js script (no additional dependencies required, uses built-in modules)
  • Python solution: use call.py script (requires installing the requests library)
  • Recommended solution: when the user does not specify Python, or the Python environment is uncertain, prioritize the Node.js solution
  • query: the query parameter of stock and fund data query tools generally supports multiple entities and multiple indicators, but should not exceed 10

First-time use

  • Configure key: config.json is used to store the user's key. If no valid key exists, prompt the user to obtain a key from "iFinD Terminal - Tools - Common Tools - Data MCP", help them complete the key writing, or write it manually

Data scope

  • Stock data: stock search, basic information, financial data, market quotes, shareholders, risk indicators, ESG ratings, major events, etc.
  • Fund data: fund search, fund information, fund market quotes, holdings details, holder structure, fund company information, etc.
  • Macroeconomic data: GDP, CPI, PPI, industry economic indicators, commodity data, etc.
  • News announcements: financial news, listed company announcements, hot events, etc.

Usage tips

  • 1.Search first, then query: for macroeconomic and industry economic indicators, when you cannot determine the specific indicator the user wants, you can first use search_edb to search, then based on the search result indicators and the context initiate a data query with get_edb_data
  • 2.Query merging: stock and fund data query related tools support multiple entities and multiple indicators, for example {"query":"Tonghuashun, East Money, Dazhihui, Hundsun Electronics' 2025-09-30 net profit growth rate, ROE, ROA"}, with the number of entities and indicators controlled within 5
  • 3.Sector-type stock entities: stock data query supports directly using industry sector-type stocks as entities, directly querying data related to stocks in a certain industry, but note that the industry scope or time range should not be too large, to avoid triggering overly long truncation, for example {"query":"today's price change of lithium battery industry stocks"}

Core function

call(server_type, tool_name, params)

Initiate a financial data request.

Parameters:

  • server_type (str): service type, value range:
    • "stock" - stock service
    • "fund" - fund service
    • "edb" - macroeconomic/industry economic indicator service
    • "news" - news announcement service
  • tool_name (str): tool name, see the tool list below
  • params (dict): request parameters, parameters differ for different tools

Return value:

{
    "ok": True/False,
    "status_code": HTTP状态码,
    "data": ...,      # ok=True时返回
    "error": ...,     # ok=False时返回
    "raw": ...        # 原始响应
}

list_tools(server_type)

List all available tools for the specified service type.


Stock service tools (server_type="stock")

Tool name Function description Typical parameters
search_stocks Smart stock selection {"query": "自然语言选股条件"} e.g., "电子行业市值大于100亿"
get_stock_summary Stock information summary {"query": "股票简称+查询内容"} e.g., "茅台财务状况"
get_stock_info Stock basic information, daily frequency quotes and technical indicators {"query": "股票简称+指标名称+时间"} e.g., "格力电器上市时间"or"三花智控近5日涨跌幅"
get_stock_shareholders Share capital structure and shareholder data {"query": "股票简称+指标"} e.g., "光明乳业流通股占比"
get_stock_financials Financial data and indicators {"query": "股票简称+财务指标+财报日期"} e.g., "科大讯飞2025年三季度的ROE"
get_risk_indicators Quantitative risk indicators {"query": "股票+时间+指标"} e.g., "航天电子在2026-03-19的夏普比率"
get_stock_events Major event indicators of listed companies {"query": "股票+事件相关指标"} e.g., "摩尔线程IPO首发股本数量"
get_esg_data ESG rating data {"query": "股票+ESG评级指标"} e.g., "诚意药业中诚信ESG评级"

Stock selection query example


# 智能选股
call("stock", "search_stocks", {"query": "汽车零部件行业市值大于1000亿的股票"})


Fund service tools (server_type="fund")

Tool name Function description Typical parameters
search_funds Fund search {"query": "模糊基金名称或选基需求"} e.g., "南方基金新能源ETF"
get_fund_profile Fund basic information {"query": "基金名称+指标"} e.g., "工银双盈债券A(010068)的发行日期与发行费率"
get_fund_market_performance Fund quotes and performance {"query": "基金名称+时间范围+指标"} e.g., "方正富邦策略精选A(010072)在近一月收益率"
get_fund_ownership Fund shares and holders {"query": "基金名称+日期+指标"} e.g., "湘财长弘灵活配置混合A(010076)在2025-06-30的申购总份额和赎回总份额"
get_fund_portfolio Fund holdings details {"query": "基金名称+日期+指标"} e.g., "工银优质成长混合A(010088)在2025-06-30披露报告中的股票投资占比"
get_fund_financials Fund financial indicators {"query": "基金名称+日期+指标"} e.g., "泰康浩泽混合A(010081)在2025-06-30的利润"
get_fund_company_info Fund company information {"query": "基金名称+所属基金公司维度指标"} e.g., "蜂巢丰瑞的所属基金公司基金经理数量"

Macroeconomic/industry economic indicator service (server_type="edb")

  • Macro industry economic indicators support "search first, then retrieve data". When you are unsure of the specific indicator, you can first initiate a search request, then select specific indicators to query based on user needs
Tool name Function description Typical parameters
search_edb Indicator search {"query": "行业/产品/指标描述"} e.g., "光模块产业链相关指标"
get_edb_data Indicator data query {"query": "指标名称+时间范围"} e.g., "光伏电池产量202301-202506"

EDB query example

# 搜索可能的指标
call("edb", "search_edb", {"query": "新能源汽车产量相关指标"})

# 获取具体数据
call("edb", "get_edb_data", {"query": "新能源汽车产量当月值(202301-202506)"})

News announcement service (server_type="news")

  • The news announcement service has built-in semantic retrieval capability, supporting input of the content to be queried and returning relevant passages rather than the full announcement text
  • The hot event query tool focuses on timeliness; parameter restrictions should not be too many, otherwise it is easy to get no results. When there are no results, try relaxing the restrictions, or choose news search
  • The query field supports inputting both report metadata requirements and query content at the same time, e.g., {"query":"Youyan Xincai 2024 annual report solid-state battery technology related"}
Tool name Function description Typical parameters
search_news News semantic retrieval {"query": "内容", "time_start": "开始日期", "time_end": "结束日期", "size": 数量}
search_notice Announcement semantic retrieval {"query": "内容", "time_start": "开始日期", "time_end": "结束日期", "size": 数量}
search_trending_news Hot event news query {"keyword": "关键词", "industry_name": "行业", "time_scope": "时效范围", "size": 数量}

News query example

# 财经新闻
call("news", "search_news", {
    "query": "脑机接口技术最新进展",
    "time_start": "2025-01-01",
    "time_end": "2026-01-01",
    "size": 5
})

# 上市公司公告
call("news", "search_notice", {
    "query": "光迅科技2024年度报告 光模块技术",
    "time_start": "2025-01-01",
    "time_end": "2026-01-01",
    "size": 5
})

# 热点事件
call("news", "search_trending_news", {
    "keyword": "智能体",
    "industry_name": "计算机",
    "time_scope": "24小时",
    "size": 5
})

Usage example

This skill provides two invocation options. Please choose according to your environment (if the user has not specified and the Python environment is unclear, prefer the Node.js option):

Option 1: Node.js script invocation method

const { call, listTools } = require('./call-node.js');

async function main() {
    // 查询股票数据
    const result1 = await call("stock", "search_stocks", { query: "电子行业市值排名前20的股票" });
    console.log(JSON.stringify(result1, null, 2));

    // 查询基金数据
    const result2 = await call("fund", "search_funds", { query: "南方基金的新能源ETF" });
    console.log(JSON.stringify(result2, null, 2));

    // 查询宏观经济数据
    const result3 = await call("edb", "get_edb_data", { query: "光伏电池产量当月值(202301-202506)" });
    console.log(JSON.stringify(result3, null, 2));

    // 查询新闻
    const result4 = await call("news", "search_news", {
        query: "人工智能行业动态",
        time_start: "2025-01-01",
        time_end: "2026-01-01",
        size: 5
    });
    console.log(JSON.stringify(result4, null, 2));
}

main().catch(console.error);

Option 2: Python script invocation method

from call import call, list_tools

# 查询股票数据
result = call("stock", "search_stocks", {"query": "电子行业市值排名前20的股票"})
print(result)

# 查询基金数据
result = call("fund", "search_funds", {"query": "南方基金的新能源ETF"})
print(result)

# 查询宏观经济数据
result = call("edb", "get_edb_data", {"query": "光伏电池产量当月值(202301-202506)"})
print(result)

# 查询新闻
result = call("news", "search_news", {
    "query": "人工智能行业动态",
    "time_start": "2025-01-01",
    "time_end": "2026-01-01",
    "size": 5
})
print(result)

Node.js option features:

  • No need to install additional dependency libraries; use Node.js built-in http/https module
  • Asynchronous function design, supports async/await syntax
  • Uses the same configuration file as the Python solution mcp_config.json

Notes

  1. Configuration file mcp_config.json must contain a valid auth_token(shared by both solutions)
  2. The request URL is already built into the request scripts call.py and call-node.js, and the key in the configuration file is already referenced in the scripts, so you can call them directly without needing to re-read or generate the URL and key
  3. All function return results need to be checked for the ok field to confirm whether the request was successful
  4. Time parameter format:YYYY-MM-DD
  5. search_edb Can be used for fuzzy search when the specific metric name is uncertain
  6. If there is no Python environment, you can use the Node.js solution (call-node.js), with no dependencies to install
  7. After a single request is completed, please help the user delete the temporary data-fetching script you generated